[clang] [clang][Sema] Add regression test for GH91131 (PR #236018)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 2 18:57:35 PST 2026


================
@@ -364,6 +364,31 @@ namespace rdar12629723 {
   };
 }
 
+namespace GH91131 {
+  template <typename T>
+  struct B : T {};
+
+  template <typename T>
+  struct A : B<T> {};
+
+  // expected-note at +1 {{attempt to specialize declaration here}}
+  struct C {}; // first declaration (valid and complete)
+
+  // expected-error at +1 {{extraneous 'template<>' in declaration of struct 'C'}}
+  template <>
+  struct C {}; // second declaration (invalid)
+  // expected-error at -1 {{specialization of member 'GH91131::C' does not specialize an instantiated member}}
+
+  // crash before pull 92597:
----------------
shafik wrote:

We can leave out the issue numbers since the summary references the issue we can go to the issue to discover these details.

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


More information about the cfe-commits mailing list