https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113342

Richard Ebeling <gcc-bugzilla at richardebeling dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gcc-bugzilla@richardebeling
                   |                            |.de

--- Comment #3 from Richard Ebeling <gcc-bugzilla at richardebeling dot de> ---
Can confirm this behavior, I stumbled across this when using the common name
`T` as a type template parameter name in a class that also happened to define
an enum value named `T`.

The error message also was not user-friendly in this case:
> error: 'T' does not name a type

Reproducible with GCC 15.2 and trunk on godbolt:
https://godbolt.org/z/cn7ndq3dG

```
struct X {
  enum SomeEnum { T };

  template <class T>
  inline void test(const T*);
};

template <class T>
void X::test(const T*) {}
```

Reply via email to