https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97446
Bug ID: 97446 Summary: gcc accepts an unnamed struct Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, the following code has an error in 'S3' (maybe should be 'S2'). gcc accepts it without error diagnostics. $ cat s.cpp template < class T > struct S1 { struct S2 { friend struct S1 <T>::S3; }; }; $ clang++ -c s.cpp s.cpp:3:32: error: no struct named 'S3' in 'S1<T>' friend struct S1 <T>::S3; ~~~~~~~~^ 1 error generated.