https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107408
Bug ID: 107408
Summary: Inaccurate "error: too many template-parameter-lists"
diagnostic for missing template argument list
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: redi at gcc dot gnu.org
Target Milestone: ---
template<class T> struct S
{
template<class U> S(U);
};
template<class T> template<class U> S::S(U) { }
This prints:
t.C:6:38: error: too many template-parameter-lists
6 | template<class T> template<class U> S::S(U) { }
| ^~
The caret is in the right location, but the diagnostic message is misleading.
The problem is a missing template argument list, it should be S<T>::S(U)