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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2017-08-17 00:00:00         |2018-8-29

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The first example was fixed for GCC 4.8.0

The second started saying "template argument 1 is invalid" in GCC 4.8.0 and
stopped also saying "invalid type in declaration" for GCC 5.1.0

The caret locations for "template argument 1" are poor though, they point to
the end of the template argument list.


For the second and third ones Clang gives a nicer diagnostic:

45113.cc:2:15: error: type-id cannot have a name
typedef U<int x,int y> A;
              ^
45113.cc:2:21: error: type-id cannot have a name
typedef U<int x,int y> A;
                    ^
2 errors generated.


That's accurate and helpful. We could even add a fix-it to remove those names.

Reply via email to