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