[clang] [Clang] Implement P0963R3 "Structured binding declaration as a condition" (PR #130228)

via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 10 02:25:36 PDT 2025


================
@@ -4224,15 +4224,18 @@ class DecompositionDecl final
     : public VarDecl,
       private llvm::TrailingObjects<DecompositionDecl, BindingDecl *> {
   /// The number of BindingDecl*s following this object.
-  unsigned NumBindings;
+  unsigned NumBindings : 31;
+
+  LLVM_PREFERRED_TYPE(bool)
+  unsigned IsDecisionVariable : 1;
----------------
cor3ntin wrote:

Each of these functions is used ~5 times; I don't understand why it would be a huge burden.

Instead of a boolean, you could add new functions such as `EmitConditionDecl` and call that from the few places where the variable is a condition variable.

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


More information about the cfe-commits mailing list