[clang] [clang] Don't lose track of explicit specializations of member functi… (PR #111267)

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 5 19:29:38 PDT 2024


================
@@ -156,7 +156,13 @@ namespace UsesThis {
     auto h<int>() -> decltype(this); // expected-error {{'this' cannot be used in a static member function declaration}}
   };
 
-  template struct A<int>; // expected-note 3{{in instantiation of}}
+  template struct A<int>; // expected-note {{in instantiation of}}
+  template<> template<> void A<int>::f<int>();
+  template<> template<> void A<int>::g<int>();
+  void test1() {
+    A<int>().f<int>(); // expected-note {{in instantiation of}}
+    A<int>().g<int>(); // expected-note {{in instantiation of}}
+  }
----------------
mizvekov wrote:

No, we are still producing the same bunch of diagnostics, except now only when we use the function, instead of when instantiating the enclosing class.
This matches the behavior of MSVC.

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


More information about the cfe-commits mailing list