https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96852
Bug ID: 96852 Summary: Missing diagnostic message for friend declaration with wrong number of template arguments. Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Program (main.cpp): template<typename> class A { }; class B { template<typename, typename> friend class ::A; }; int main() { } Compilation command line: g++ -std=c++17 -pedantic-errors main.cpp Observed behaviour: No compilation errors. Expected behaviour: Compilation error about using the wrong number of template arguments in the firend declaration. Note: clang++ gives the expected error message.