https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96045
Bug ID: 96045 Summary: Wrong line and column diagnostic message in a class template instantiation Product: gcc Version: 11.0 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- This simple code, bug.cc, GCC-trunk can not emit the right diagnostic information. $cat bug.cc template <class> class A {}; struct A <int> $g++ -c bug.cc bug.cc:3: error: expected unqualified-id at end of input Noted that the number 3 is not a line number nor a column number. While in Clang $clang++ -c bug.cc bug.cc:2:16: error: expected unqualified-id struct A <int> ^ 1 error generated. $g++ --version g++ (GCC) 11.0.0 20200630 (experimental) Copyright (C) 2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.