File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 3055
3055
member function, then all functions named shall be accessible. The base
3056
3056
class members mentioned by a \grammarterm {using-declarator} shall be
3057
3057
visible in the scope of at least one of the direct base classes of the
3058
- class where the \grammarterm {using-declarator} is specified. \begin {note }
3058
+ class where the \grammarterm {using-declarator} is specified.
3059
+
3060
+ \pnum
3061
+ \begin {note }
3059
3062
Because a \grammarterm {using-declarator} designates a base class member
3060
3063
(and not a member subobject or a member function of a base class
3061
3064
subobject), a \grammarterm {using-declarator} cannot be used to resolve
3062
- inherited member ambiguities. For example,
3063
-
3065
+ inherited member ambiguities.
3066
+ \begin { example }
3064
3067
\begin {codeblock }
3065
3068
struct A { int x(); };
3066
3069
struct B : A { };
3074
3077
int x(double);
3075
3078
};
3076
3079
int f(D* d) {
3077
- return d->x(); // ambiguous: \tcode {B ::x} or \tcode {C::x}
3080
+ return d->x(); // error: overload resolution selects \tcode {A ::x}, but \tcode {A} is an ambiguous base class
3078
3081
}
3079
3082
\end {codeblock }
3083
+ \end {example }
3080
3084
\end {note }
3081
3085
3082
3086
\pnum
You can’t perform that action at this time.
0 commit comments