diff options
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 6 | ||||
-rw-r--r-- | test/SemaCXX/tag-ambig.cpp | 11 |
2 files changed, 13 insertions, 4 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 71bea3c92d..cd6dc9227e 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -6763,7 +6763,8 @@ Decl *Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK, // shouldn't be diagnosing. LookupName(Previous, S); - if (Previous.isAmbiguous() && TUK == TUK_Definition) { + if (Previous.isAmbiguous() && + (TUK == TUK_Definition || TUK == TUK_Declaration)) { LookupResult::Filter F = Previous.makeFilter(); while (F.hasNext()) { NamedDecl *ND = F.next(); @@ -6771,9 +6772,6 @@ Decl *Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK, F.erase(); } F.done(); - - if (Previous.isAmbiguous()) - return 0; } // Note: there used to be some attempt at recovery here. diff --git a/test/SemaCXX/tag-ambig.cpp b/test/SemaCXX/tag-ambig.cpp index 42cb9604b0..6403cf3059 100644 --- a/test/SemaCXX/tag-ambig.cpp +++ b/test/SemaCXX/tag-ambig.cpp @@ -15,3 +15,14 @@ public: struct Point { }; virtual bool testMethod (Test::Point& p) = 0; }; + +// PR8151 +namespace A { struct Face {}; } +namespace B { struct Face {}; } +using namespace A; +using namespace B; + +class C { + struct Face; + Face *mFaces; +}; |