summaryrefslogtreecommitdiffstats
path: root/clang/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
commita419dbb5ea0b07d5fe4fb4eaf5a90d2801161e4c (patch)
tree2fe2bf1babb6131d381cb80cb5bebc377ef59d0d /clang/lib/Sema/SemaDecl.cpp
parentefc83e60d349da075491f03373ffed92065afb0a (diff)
downloadbcm5719-llvm-a419dbb5ea0b07d5fe4fb4eaf5a90d2801161e4c.tar.gz
bcm5719-llvm-a419dbb5ea0b07d5fe4fb4eaf5a90d2801161e4c.zip
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. llvm-svn: 97499
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 4842da2a7b5..1d448d0de82 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud