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

            Bug ID: 102771
           Summary: show fix-it for missing period in variadic template:
                    template<typename.. T>
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: enhancement
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

template<typename.. T> void f(T...) { }


vart.C:1:18: error: expected nested-name-specifier before ‘.’ token
    1 | template<typename.. T> void f(T...) { }
      |                  ^
vart.C:1:18: error: expected ‘>’ before ‘.’ token
vart.C:1:29: error: variable or field ‘f’ declared void
    1 | template<typename.. T> void f(T...) { }
      |                             ^
vart.C:1:31: error: ‘T’ was not declared in this scope
    1 | template<typename.. T> void f(T...) { }
      |                               ^


This could be improved. If we see a . token after "typename" or "class" (or
"auto"?) then instead of just giving an error, see if the next token is also
"." and if so, the user probably meant to write "..."

We should show a fix-it saying "did you mean '...'?"

Reply via email to