diff options
| author | Kaelyn Uhrain <rikka@google.com> | 2012-04-26 23:36:17 +0000 |
|---|---|---|
| committer | Kaelyn Uhrain <rikka@google.com> | 2012-04-26 23:36:17 +0000 |
| commit | 031643ef487dbe55508c5ad7a600f2385bac9288 (patch) | |
| tree | e9987d5077172f78275470beeaaf431f786e9ac3 /clang/lib/Sema | |
| parent | c90abc89566082b633abc2ccd09362f46e0e77d2 (diff) | |
| download | bcm5719-llvm-031643ef487dbe55508c5ad7a600f2385bac9288.tar.gz bcm5719-llvm-031643ef487dbe55508c5ad7a600f2385bac9288.zip | |
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.
llvm-svn: 155677
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 38bb852fa23..ec950d18421 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/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; } |

