[Bug c++/97479] New: Auto as template argument

anders.granlund.0 at gmail dot com gcc-bugzilla@gcc.gnu.org
Sun Oct 18 14:38:10 GMT 2020


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

            Bug ID: 97479
           Summary: Auto as template argument
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anders.granlund.0 at gmail dot com
  Target Milestone: ---

Consider the following program:

  template<typename>
  class A
  {
  };

  int main()
  {
    A<auto> a = A<void>();
  }

It is accepted when compiling it with "-std=c++20 -pedantic-errors". 

The expected behaviour is that the compiler should reject the program.

Note that clang correctly rejects it:

  https://godbolt.org/z/nnh5c7


More information about the Gcc-bugs mailing list