C++ Logo

std-discussion

Advanced search

Re: using and weird member access

From: Ell <ell.ell.se_at_[hidden]>
Date: Tue, 12 May 2026 13:46:40 +0000
On Tuesday, May 12th, 2026 at 2:49 PM, Yongwei Wu via Std-Discussion <std-discussion_at_[hidden]> wrote:

> Actually, if we change
>
> struct Derived : public Middle { public: using ::Base::member; };
>
> to
>
> struct Derived : public Middle { public: using Base::member; };
>
> Clang will reject the code. So it seems to me that Clang is applying different rules to the type identification and the using declaration. But [namespace.udecl]/3 says each using-declarator shall either name an enumerator or have a nested-name-specifier naming a base class of the current class.
>
> So now I think Clang is simply confused and this is a bug.

`Base` in this context refers to Base's injected class name, which is inaccessible
(unlikne `::Base`).

Received on 2026-05-12 13:46:50