Skip to content

Commit 89c9b0b

Browse files
committed
[namespace.udecl] Clarify error in example.
1 parent 3750b23 commit 89c9b0b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

source/declarations.tex

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3057,12 +3057,15 @@
30573057
member function, then all functions named shall be accessible. The base
30583058
class members mentioned by a \grammarterm{using-declarator} shall be
30593059
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}
30613064
Because a \grammarterm{using-declarator} designates a base class member
30623065
(and not a member subobject or a member function of a base class
30633066
subobject), a \grammarterm{using-declarator} cannot be used to resolve
3064-
inherited member ambiguities. For example,
3065-
3067+
inherited member ambiguities.
3068+
\begin{example}
30663069
\begin{codeblock}
30673070
struct A { int x(); };
30683071
struct B : A { };
@@ -3076,9 +3079,10 @@
30763079
int x(double);
30773080
};
30783081
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
30803083
}
30813084
\end{codeblock}
3085+
\end{example}
30823086
\end{note}
30833087

30843088
\pnum

0 commit comments

Comments
 (0)