https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105811
Bug ID: 105811 Summary: Diagnostics for template class member call with missing template parameters can be improved Product: gcc Version: 12.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: llvm at rifkin dot dev Target Milestone: --- The following code: namespace ns { template<int = 1> struct S { void foo() {} }; } void foo(ns::S<1>& s) { s.ns::S::foo(); s.ns::S::~S(); } Produces the following diagnostics: <source>: In function 'void foo(ns::S<1>&)': <source>:9:11: error: 'template<int <anonymous> > struct ns::S' used without template arguments 9 | s.ns::S::foo(); | ^ <source>:10:7: error: 'ns::S' is not a class member 10 | s.ns::S::~S(); | ^~ Compiler returned: 1 https://godbolt.org/z/89fbbWhhh I'm not sure why the destructor call is being treated differently, it would be great if it would also specify the issue is missing template arguments.