[clang] [Codegen] Initialize RValue IsVolatile field in constructor (PR #195556)

via cfe-commits cfe-commits at lists.llvm.org
Sun May 3 15:29:38 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Shafik Yaghmour (shafik)

<details>
<summary>Changes</summary>

Static analysis flagged that in some cases IsVolatile is left uninitialzed. I adjusted the constructor to initialize IsVolatile.

---
Full diff: https://github.com/llvm/llvm-project/pull/195556.diff


1 Files Affected:

- (modified) clang/lib/CodeGen/CGValue.h (+1-1) 


``````````diff
diff --git a/clang/lib/CodeGen/CGValue.h b/clang/lib/CodeGen/CGValue.h
index 373ea55147404..118ed6690627c 100644
--- a/clang/lib/CodeGen/CGValue.h
+++ b/clang/lib/CodeGen/CGValue.h
@@ -59,7 +59,7 @@ class RValue {
   unsigned Flavor : 2;
 
 public:
-  RValue() : Vals{nullptr, nullptr}, Flavor(Scalar) {}
+  RValue() : Vals{nullptr, nullptr}, IsVolatile(false), Flavor(Scalar) {}
 
   bool isScalar() const { return Flavor == Scalar; }
   bool isComplex() const { return Flavor == Complex; }

``````````

</details>


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


More information about the cfe-commits mailing list