[clang] [Clang][Bytecode][NFS] Init Semantics non-static member of class Floating (PR #153671)

via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 14 13:26:52 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Shafik Yaghmour (shafik)

<details>
<summary>Changes</summary>

Static analysis flagged that the non-static member Semantics was not initialized by the default default constructor. Fix is to initialize it using in class member initialization.

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


1 Files Affected:

- (modified) clang/lib/AST/ByteCode/Floating.h (+1-1) 


``````````diff
diff --git a/clang/lib/AST/ByteCode/Floating.h b/clang/lib/AST/ByteCode/Floating.h
index 659892e720abf..9561aee434d91 100644
--- a/clang/lib/AST/ByteCode/Floating.h
+++ b/clang/lib/AST/ByteCode/Floating.h
@@ -38,7 +38,7 @@ class Floating final {
     uint64_t Val = 0;
     uint64_t *Memory;
   };
-  llvm::APFloatBase::Semantics Semantics;
+  llvm::APFloatBase::Semantics Semantics{};
 
   APFloat getValue() const {
     unsigned BitWidth = bitWidth();

``````````

</details>


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


More information about the cfe-commits mailing list