[clang] [Clang][Sema] Differentiate between partial/explicit specializations when diagnosing unexpanded packs (PR #72015)

Krystian Stasiowski via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 13 07:50:18 PST 2023


================
@@ -369,9 +369,39 @@ void test_unexpanded_exprs(Types ...values) {
   void f(int arg = values); // expected-error{{default argument contains unexpanded parameter pack 'values'}}
 }
 
-// Test unexpanded parameter packs in partial specializations.
-template<typename ...Types>
-struct TestUnexpandedDecls<int, Types>; // expected-error{{partial specialization contains unexpanded parameter pack 'Types'}}
+// Test unexpanded parameter packs in partial/explicit specializations.
+namespace Specializations {
----------------
sdkrystian wrote:

@erichkeane The existing behavior is to call explicit specializations "partial specializations" in the diagnostic for unexpanded parameter packs. This patch fixes that, so a distinction is made between partial/explicit specializations. For example, the test on line 391 displays different behavior:
```cpp
struct InnerClass<Ts>; // expected-error{{explicit specialization contains unexpanded parameter pack 'Ts'}}
```
Note "explicit specialization" in the diagnostic. 

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


More information about the cfe-commits mailing list