<div dir="ltr">Which compiler/what sort of warning was this addressing? (it can be beneficial to leave variables uninitialized if their value isn't intended to be used - so things like asan can catch bugs where the read of uninitialized is unintended)</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Nov 2, 2019 at 11:27 AM Simon Pilgrim via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Author: Simon Pilgrim<br>
Date: 2019-11-02T18:03:21Z<br>
New Revision: d0f3c822160e36e10588bc86dabde6ab8d63cf10<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/d0f3c822160e36e10588bc86dabde6ab8d63cf10" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/d0f3c822160e36e10588bc86dabde6ab8d63cf10</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/d0f3c822160e36e10588bc86dabde6ab8d63cf10.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/d0f3c822160e36e10588bc86dabde6ab8d63cf10.diff</a><br>
<br>
LOG: Fix uninitialized variable warnings. NFCI.<br>
<br>
Added: <br>
<br>
<br>
Modified: <br>
clang/utils/TableGen/ClangDiagnosticsEmitter.cpp<br>
<br>
Removed: <br>
<br>
<br>
<br>
################################################################################<br>
diff --git a/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp b/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp<br>
index 778375010041..f694c3e4380a 100644<br>
--- a/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp<br>
+++ b/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp<br>
@@ -134,7 +134,7 @@ namespace {<br>
<br>
const Record *ExplicitDef;<br>
<br>
- GroupInfo() : ExplicitDef(nullptr) {}<br>
+ GroupInfo() : IDNo(0), ExplicitDef(nullptr) {}<br>
};<br>
} // end anonymous namespace.<br>
<br>
@@ -554,7 +554,7 @@ struct SelectPiece : Piece {<br>
<br>
ModifierType ModKind;<br>
std::vector<Piece *> Options;<br>
- int Index;<br>
+ int Index = 0;<br>
<br>
static bool classof(const Piece *P) {<br>
return P->getPieceClass() == SelectPieceClass ||<br>
@@ -566,7 +566,7 @@ struct PluralPiece : SelectPiece {<br>
PluralPiece() : SelectPiece(PluralPieceClass, MT_Plural) {}<br>
<br>
std::vector<Piece *> OptionPrefixes;<br>
- int Index;<br>
+ int Index = 0;<br>
<br>
static bool classof(const Piece *P) {<br>
return P->getPieceClass() == PluralPieceClass;<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>