[Note: the interpretation of the call of a virtual function depends on the type of the object for which it is called (the dynamic type), whereas the interpretation of a call of a nonvirtual member function depends only on the type of the pointer or reference denoting that object (the static type) (5.2.2). ]
C++标准明确说了虚拟函数调用是依赖动态类型的,这里并没有加上对qualified-id的例外。那么,按照这个条款,A::fun()也是根据动态类型解析的,解析的目标是找到final overrider,方法是member name lookup:
10.3 Virtual functions .............Then in any well-formed class, for each virtual function declared in that class or any of its direct or indirect base classes there is a unique final overrider that overrides that function and every other overrider of that function. The rules for member lookup (10.2) are used to determine the final overrider for a virtual function in the scope of a derived class but ignoring names introduced by using-declarations.
这个member name lookup是怎样的呢?C++标准是这样描述的:
10.2 Member name lookup
.........For an id-expression, name lookup begins in the class scope of this; for a qualified-id, name lookup begins in the scope of the nested-name-specifier.