[llvm] [compiler-rt] [clang] [clang-tools-extra] [mlir] [clang] Fix a bug with qualified name lookup into current instantiation (PR #73018)

via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 1 08:53:59 PST 2023


john-brawn-arm wrote:

I'm not completely sure if we should be giving an error for the example I gave above. Looking through the C++20 standard I see temp.res paragraph 2:
>  A name used in a template declaration or definition and that is dependent on a template-parameter is assumed
not to name a type unless the applicable name lookup finds a type name or the name is qualified by the
keyword typename

The error that gcc is giving is
```
<source>:6:6: error: invalid use of incomplete type 'struct Y<A>'
    6 |   Y::E m;
      |      ^
<source>:5:25: note: definition of 'struct Y<A>' is not complete until the closing brace
    5 | template <int A> struct Y : X<A> {
      |                         ^
```
so I'm guessing that gcc thinks that the name lookup for ``Y::E`` doesn't find a type name because ``Y`` is incomplete, though I don't understand why the same isn't true for the example in 
```

https://github.com/llvm/llvm-project/pull/73018


More information about the cfe-commits mailing list