-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Open
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"
Description
Test code (CE):
struct A {
int B;
struct B {};
};
struct S1 : A::B {}; // OK
// - EDG/MSVC: OK
// - GCC (<= 12.5): OK
// - GCC (>= 13.1): error: 'typename A::B' names 'int A::B', which is
// not a type
// - Clang: error: typename specifier refers to non-type member 'B' in
// 'A'
template <class T> struct S2 : T::B {};
template class S2<A>;
According to [class.derived.general]/2 (from N4950, the C++23 final draft):
[...] The lookup for the component name of the type-name or simple-template-id is type-only ([basic.lookup]). [...]
Therefore, the lookup for B
in T::B
should be type-only (ignoring non-type names), since T::B
appears within a class-or-decltype (which can be produced by a base-specifier or a mem-initializer-id).
Related: Bug 122192.
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"