diff options
author | Hans Wennborg <hans@hanshq.net> | 2012-09-21 08:58:33 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2012-09-21 08:58:33 +0000 |
commit | 61b2ffa60f6e75a5ce057ebcc88647d1574e42b0 (patch) | |
tree | 43a423cb95b9a354b5e55366f09c0a7283283cc9 /clang/lib/Sema/SemaDecl.cpp | |
parent | ad1191fbb68faa69b43c2b6b5aa7d6cefc6f7c6b (diff) | |
download | bcm5719-llvm-61b2ffa60f6e75a5ce057ebcc88647d1574e42b0.tar.gz bcm5719-llvm-61b2ffa60f6e75a5ce057ebcc88647d1574e42b0.zip |
Make warnings about uninitialized fields include the field name.
This makes the wording more informative, and consistent with the other
warnings about uninitialized variables.
Also, me and David who reviewed this couldn't figure out why we would
need to do a lookup to get the name of the variable; so just print the
name directly.
llvm-svn: 164366
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index cbc3469fc77..fc2d1d6ae6e 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -6328,14 +6328,12 @@ namespace { void HandleDeclRefExpr(DeclRefExpr *DRE) { Decl* ReferenceDecl = DRE->getDecl(); if (OrigDecl != ReferenceDecl) return; - LookupResult Result(S, DRE->getNameInfo(), Sema::LookupOrdinaryName, - Sema::NotForRedeclaration); unsigned diag = isReferenceType ? diag::warn_uninit_self_reference_in_reference_init : diag::warn_uninit_self_reference_in_init; S.DiagRuntimeBehavior(DRE->getLocStart(), DRE, S.PDiag(diag) - << Result.getLookupName() + << DRE->getNameInfo().getName() << OrigDecl->getLocation() << DRE->getSourceRange()); } |