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

            Bug ID: 106405
           Summary: GCC incorrectly accepts function template
                    specialization
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jlame646 at gmail dot com
  Target Milestone: ---

The following program is successfully compiled with gcc even though it is not
valid and so should give a compile time error: https://godbolt.org/z/3xsKKbxE3

template< typename T > int func(); // (1)
template< typename ... Args > int func();  // (2)
template<> int func<int>() { return 1; }  //this should give error but gcc
compiles this without any error
int main() {

}

Reply via email to