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

            Bug ID: 115923
           Summary: different diagnostic if using qualified name vs not
                    for missing template arguments
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: enhancement
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Take:
```
template<int> struct extent{};

struct extent t;
struct ::extent t1;
```

GCC currently produces:
```

<source>:4:8: error: template argument required for 'struct extent'
    4 | struct extent t;
      |        ^~~~~~
<source>:5:10: error: invalid use of template-name 'extent' without an argument
list
    5 | struct ::extent t1;
      |          ^~~~~~
<source>:2:22: note: 'template<int <anonymous> > struct extent' declared here
    2 | template<int> struct extent{};
      |                      ^~~~~~
```

The error messages are correct but they are different and the qualified name
even gives where the definition was originally defined while the non-qualified
one does not. It would be useful if the non-qualified gives the same error
message and where the original definition was.

Reply via email to