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 | 7821e0756744018a34c533f30cdabe62a72d4e4a (patch) | |
tree | 34d6731565b0a60e940358f1b5c4cc61520167aa /lib/Sema/SemaDecl.cpp | |
parent | 85cb7a5696f93f8b98604d3e72525921a32537f0 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164366 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index cbc3469fc7..fc2d1d6ae6 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/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()); } |