Skip to content

[namespace.udecl] Clarify error in example. #1254

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 4, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions source/declarations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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 { };
Expand All @@ -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
Expand Down