aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorKaelyn Uhrain <rikka@google.com>2012-04-26 23:36:17 +0000
committerKaelyn Uhrain <rikka@google.com>2012-04-26 23:36:17 +0000
commitaec2ac67e7190bdb88abb1d427b82ae3284ea756 (patch)
treed835e2740d0381136393c75b45ebb3c8fab28ce1 /lib/Sema/SemaDecl.cpp
parent65a7c685b78c18dc158399d2cc688a611d5e2553 (diff)
Add note to help explain why a tag such as 'struct' is needed to refer
to a given type, when the reason is that there is a non-type decl with the same name. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155677 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 38bb852fa2..ec950d1842 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -564,6 +564,14 @@ Corrected:
Diag(NameLoc, diag::err_use_of_tag_name_without_tag)
<< Name << TagName << getLangOpts().CPlusPlus
<< FixItHint::CreateInsertion(NameLoc, FixItTagName);
+
+ LookupResult R(*this, Name, NameLoc, LookupOrdinaryName);
+ if (LookupParsedName(R, S, &SS)) {
+ for (LookupResult::iterator I = R.begin(), IEnd = R.end();
+ I != IEnd; ++I)
+ Diag((*I)->getLocation(), diag::note_decl_shadowing_tag_type)
+ << Name << TagName;
+ }
break;
}