| Issue |
162813
|
| Summary |
Lookup for a dependent nested type as a base-specifier should be type-only
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
ckwastra
|
Test code ([CE](https://godbolt.org/z/7f8PE88xs)):
```cpp
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](https://timsong-cpp.github.io/cppwp/n4950/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](https://timsong-cpp.github.io/cppwp/n4950/class.derived.general#nt:class-or-decltype)* (which can be produced by a *[base-specifier](https://timsong-cpp.github.io/cppwp/n4950/class.derived.general#nt:base-specifier)* or a *[mem-initializer-id](https://timsong-cpp.github.io/cppwp/n4950/class.base.init#nt:mem-initializer-id)*).
Related: [Bug 122192](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122192).
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs