[clang] [Clang][Sema] Diagnose friend function specialization definitions (PR #72863)

Krystian Stasiowski via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 27 02:55:06 PST 2023


================
@@ -4,7 +4,8 @@ void f(T);
 
 template<typename T>
 struct A {
-  // expected-error at +1{{cannot declare an explicit specialization in a friend}}
+  // expected-error at +2{{cannot declare an explicit specialization in a friend}}
+  // expected-error at +1{{friend function specialization cannot be defined}}
----------------
sdkrystian wrote:

@erichkeane I suppose we don't want double-erroring for any of these https://godbolt.org/z/Wdo7bqe1v... if that is the case, perhaps we should postpone diagnosing friend function definitions until after we call `ActOnFunctionDecl`?

https://github.com/llvm/llvm-project/pull/72863


More information about the cfe-commits mailing list