[Bug c++/100640] New: GCC permits explicit instantiation of a constructor template with an explicit template argument list

richard-gccbugzilla at metafoo dot co.uk gcc-bugzilla@gcc.gnu.org
Mon May 17 18:03:18 GMT 2021


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

            Bug ID: 100640
           Summary: GCC permits explicit instantiation of a constructor
                    template with an explicit template argument list
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: richard-gccbugzilla at metafoo dot co.uk
  Target Milestone: ---

Example:

struct A {
  template<typename T> A() {}
};
template A::A<int>();

GCC accepts this without even a warning under -std=c++20 -pedantic-errors, but
this is not valid C++.

If this is an intentional extension, it doesn't appear to be documented (and
presumably should be rejected under -pedantic-errors).


More information about the Gcc-bugs mailing list