[clang] [clang] more useful error message for decomposition declaration missing initializer (PR #127924)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 1 07:33:12 PST 2025


================
@@ -140,18 +140,23 @@ namespace Template {
   template<typename T> auto [a, b, c] = n; // expected-error {{decomposition declaration template not supported}}
 }
 
+#define MYC C
+
 namespace Init {
-  void f() {
+  template<typename T> T f(T t) {
     int arr[1];
     struct S { int n; };
-    auto &[bad1]; // expected-error {{decomposition declaration '[bad1]' requires an initializer}}
+    auto &[bad1]; // expected-error {{decomposition declaration '[bad1]' requires an initializer}} expected-error {{expected initializer before ';'}}
----------------
zyn0217 wrote:

They look duplicate and are not great

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


More information about the cfe-commits mailing list