summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-12-10 19:51:03 +0000
committerJohn McCall <rjmccall@apple.com>2009-12-10 19:51:03 +0000
commite29c5cd2398c6c7a1b21b4ed631f21a2aaed4427 (patch)
tree1cb38f9b703802adc631a07b1190b052c6257db1 /clang/lib/Sema/SemaDecl.cpp
parenta430f71406aa631c3331cd7cd55fea47e7d2a115 (diff)
downloadbcm5719-llvm-e29c5cd2398c6c7a1b21b4ed631f21a2aaed4427.tar.gz
bcm5719-llvm-e29c5cd2398c6c7a1b21b4ed631f21a2aaed4427.zip
Improve the diagnostic when a new declaration conflicts with a using shadow
declaration. Rename note_using_decl to note_using, which is possibly less confusing. Add a test for non-class-scope using decl collisions and be sure to note the case we can't diagnose yet. llvm-svn: 91057
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index a171217073e..6574ad2e87d 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -803,6 +803,15 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, Decl *OldD) {
else
Old = dyn_cast<FunctionDecl>(OldD);
if (!Old) {
+ if (UsingShadowDecl *Shadow = dyn_cast<UsingShadowDecl>(OldD)) {
+ Diag(New->getLocation(), diag::err_using_decl_conflict_reverse);
+ Diag(Shadow->getTargetDecl()->getLocation(),
+ diag::note_using_decl_target);
+ Diag(Shadow->getUsingDecl()->getLocation(),
+ diag::note_using_decl) << 0;
+ return true;
+ }
+
Diag(New->getLocation(), diag::err_redefinition_different_kind)
<< New->getDeclName();
Diag(OldD->getLocation(), diag::note_previous_definition);
OpenPOWER on IntegriCloud