diff --git a/source/declarations.tex b/source/declarations.tex index 02942dd91f..1d4d6c0ba0 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -3057,12 +3057,15 @@ member function, then all functions named shall be accessible. The base class members mentioned by a \grammarterm{using-declarator} shall be visible in the scope of at least one of the direct base classes of the -class where the \grammarterm{using-declarator} is specified. \begin{note} +class where the \grammarterm{using-declarator} is specified. + +\pnum +\begin{note} Because a \grammarterm{using-declarator} designates a base class member (and not a member subobject or a member function of a base class subobject), a \grammarterm{using-declarator} cannot be used to resolve -inherited member ambiguities. For example, - +inherited member ambiguities. +\begin{example} \begin{codeblock} struct A { int x(); }; struct B : A { }; @@ -3076,9 +3079,10 @@ int x(double); }; int f(D* d) { - return d->x(); // ambiguous: \tcode{B::x} or \tcode{C::x} + return d->x(); // error: overload resolution selects \tcode{A::x}, but \tcode{A} is an ambiguous base class } \end{codeblock} +\end{example} \end{note} \pnum