[Bug c++/108486] New: explicit specialization of alias templates error message should be improved

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jan 20 22:02:34 GMT 2023


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

            Bug ID: 108486
           Summary: explicit specialization of alias templates error
                    message should be improved
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Take:
```
template<int t>
struct myinternal_int;
template<int t> using myinttype = myinternal_int<t>;
template<> using myinttype<32> = unsigned int;
```
GCC gives:
```
<source>:4:12: error: expected unqualified-id before 'using'
    4 | template<> using myinttype<32> = unsigned int;
      |            ^~~~~
```
Which is correct though not very useful for an user.
clang gives a much better error message:
```
<source>:4:1: error: explicit specialization of alias templates is not
permitted
template<> using myinttype<32> = unsigned int;
^~~~~~~~~~
```


More information about the Gcc-bugs mailing list