aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2010-03-01 21:17:36 +0000
committerChandler Carruth <chandlerc@gmail.com>2010-03-01 21:17:36 +0000
commit7bf3600f56342dc434dad994d0c71068e5d3b5c7 (patch)
tree7c1738238fb15ba25f1f5408820c738c37491de6 /lib/Sema/SemaDecl.cpp
parente6794974b706ddd51e65dcea411a6378a0f16a2e (diff)
Fix the lookup of names used in a friend declaration to not attempt to
re-declare them. This fixes PR6317. Also add the beginnings of an interesting test case for p1 of [class.friend] which also covers PR6317. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97499 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 4842da2a7b..1d448d0de8 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -4535,8 +4535,9 @@ Sema::DeclPtrTy Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
bool isStdBadAlloc = false;
bool Invalid = false;
- RedeclarationKind Redecl = (TUK != TUK_Reference ? ForRedeclaration
- : NotForRedeclaration);
+ RedeclarationKind Redecl = ForRedeclaration;
+ if (TUK == TUK_Friend || TUK == TUK_Reference)
+ Redecl = NotForRedeclaration;
LookupResult Previous(*this, Name, NameLoc, LookupTagName, Redecl);