[clang] [clang] accept member specializations declared in class scope (PR #207256)

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 3 17:03:15 PDT 2026


================
@@ -153,6 +153,12 @@ namespace cwg727 { // cwg727: partial
       // expected-error at -2 {{variable template partial specialization of 'N' not in class 'A' or an enclosing namespace}}
       //   expected-note@#cwg727-N {{explicitly specialized declaration is here}}
     };
+
+    template <class> struct E {
+      template <class> struct F {};
+    };
+    template <> template <class> struct E<void>::F {};
+    template <> template <class> struct E<char>::F {};
----------------
mizvekov wrote:

Done but FWIW this patch is only allowing these member specializations to be declared in a class scope.
The member specialization feature was already implemented and it would have been quite surprising if this didn't work correctly.

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


More information about the cfe-commits mailing list