[clang] [clang][Diagnostics] Add source range to uninitialized diagnostics (PR #65896)
Takuya Shimizu via cfe-commits
cfe-commits at lists.llvm.org
Sun Sep 10 05:59:28 PDT 2023
================
@@ -4443,7 +4444,7 @@ struct CompoundAssignSubobjectHandler {
return foundVector(Subobj, SubobjType);
case APValue::Indeterminate:
Info.FFDiag(E, diag::note_constexpr_access_uninit)
- << /*read of=*/0 << /*uninitialized object=*/1;
+ << /*read of=*/0 << /*uninitialized object=*/1 << E->getSourceRange();
----------------
hazohelet wrote:
I prefer `E->getLHS()->getSourceRange()` because the uninitialized object is known to exist in LHS.
https://github.com/llvm/llvm-project/pull/65896
More information about the cfe-commits
mailing list