[clang] [clang][bytecode] Classify varible initializer, not the decl (PR #146338)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 30 04:57:59 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp -- clang/lib/AST/ByteCode/Compiler.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp
index 91918bf38..759d5a64f 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -4582,8 +4582,8 @@ bool Compiler<Emitter>::visitDeclAndReturn(const VarDecl *VD,
     const Expr *Init = VD->getInit();
     if (!this->visit(Init))
       return false;
-    return this->emitRet(classify(Init).value_or(PT_Ptr), VD) && LS.destroyLocals() &&
-           this->emitCheckAllocations(VD);
+    return this->emitRet(classify(Init).value_or(PT_Ptr), VD) &&
+           LS.destroyLocals() && this->emitCheckAllocations(VD);
   }
 
   LocalScope<Emitter> VDScope(this, VD);

``````````

</details>


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


More information about the cfe-commits mailing list