[clang-tools-extra] [clang-doc] Initialize member variable (PR #191570)
Paul Kirth via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 10 16:20:53 PDT 2026
https://github.com/ilovepi created https://github.com/llvm/llvm-project/pull/191570
We don't always initialize the IsType field in the current
implementation. We can ensure this field is always initialized to
`false`, and avoid any UB due to garbage data.
>From 90abbf590298eb947218936e2c65ef29a540c726 Mon Sep 17 00:00:00 2001
From: Paul Kirth <paulkirth at google.com>
Date: Fri, 10 Apr 2026 23:18:24 +0000
Subject: [PATCH] [clang-doc] Initialize member variable
We don't always initialize the IsType field in the current
implementation. We can ensure this field is always initialized to
`false`, and avoid any UB due to garbage data.
---
clang-tools-extra/clang-doc/Representation.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clang-tools-extra/clang-doc/Representation.h b/clang-tools-extra/clang-doc/Representation.h
index 2ea17f5ad1036..e02de5e09b75a 100644
--- a/clang-tools-extra/clang-doc/Representation.h
+++ b/clang-tools-extra/clang-doc/Representation.h
@@ -747,7 +747,7 @@ struct ConceptInfo : public SymbolInfo, public llvm::ilist_node<ConceptInfo> {
void merge(ConceptInfo &&I);
- bool IsType;
+ bool IsType = false;
TemplateInfo Template;
StringRef ConstraintExpression;
};
More information about the cfe-commits
mailing list