aaron.ballman added a comment. Thanks for the fix for this -- I think the changes look like they're correct, but the test coverage needs a bit of work.
================ Comment at: clang/lib/Sema/SemaDecl.cpp:9191 << FixItHint::CreateInsertion(InsertLoc, "<>"); + NewFD->setInvalidDecl(); } ---------------- Alternatively, we could set `Invalid = true;` here and let the code on 9207 do its thing. We do both in this function, and I believe either approach is equivalent for this specific code path. ================ Comment at: clang/test/CXX/temp/temp.spec/temp.expl.spec/p20.cpp:16-28 +template<typename T> struct PR41792 { // expected-error@+1{{cannot declare an explicit specialization in a friend}} - template <> friend void f<>(int); + template <> friend void f<>(int) {} // expected-error@+2{{template specialization declaration cannot be a friend}} // expected-error@+1{{too few template arguments for class template 'A'}} ---------------- I don't think you should coop the existing test for an unrelated bug; can you add a new test to either SemaCXX or SemaTemplate? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113245/new/ https://reviews.llvm.org/D113245 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits