[PATCH] D138852: CWG2635: Disallow constrained structured bindings.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 28 12:31:16 PST 2022


aaron.ballman added a comment.

The changes look correct to me. The way to test the fix-it behavior is to model after one of the tests in https://github.com/llvm/llvm-project/tree/main/clang/test/FixIt (there is `-fdiagnostics-parseable-fixits` and friends for this purpose).



================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:495-496
   "declared type must be 'auto' or reference to 'auto'">;
+def err_decomp_decl_constraint : Error<"decomposition declaration cannot be "
+                                       "declared with constrained 'auto'">;
 def err_decomp_decl_parens : Error<
----------------
I think clang-format butchered your formatting, you should use the more typical style.


================
Comment at: clang/lib/Sema/SemaDeclCXX.cpp:763
   //   and cv-qualifiers.
-  // C++2a [dcl.dcl]/8:
-  //   If decl-specifier-seq contains any decl-specifier other than static,
-  //   thread_local, auto, or cv-qualifiers, the program is ill-formed.
+  // C++2a [dcl.pre]/6:
+  //   Each decl-specifier in the decl-specifier-seq shall be static,
----------------



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138852/new/

https://reviews.llvm.org/D138852



More information about the cfe-commits mailing list