[clang] [clang] Initialize DeclaratorDecl.ExtInfo.TInfo to null (PR #114198)

via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 30 02:38:14 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Boaz Brickner (bricknerb)

<details>
<summary>Changes</summary>

I believe this has no effect current behavior but would make code safer in case we forget to initialize this.

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


1 Files Affected:

- (modified) clang/include/clang/AST/Decl.h (+1-1) 


``````````diff
diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h
index 7ff35d73df5997..8c39ef3d5a9fa6 100644
--- a/clang/include/clang/AST/Decl.h
+++ b/clang/include/clang/AST/Decl.h
@@ -737,7 +737,7 @@ class DeclaratorDecl : public ValueDecl {
   // qualifier, to be used for the (uncommon) case of out-of-line declarations
   // and constrained function decls.
   struct ExtInfo : public QualifierInfo {
-    TypeSourceInfo *TInfo;
+    TypeSourceInfo *TInfo = nullptr;
     Expr *TrailingRequiresClause = nullptr;
   };
 

``````````

</details>


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


More information about the cfe-commits mailing list