From a419dbb5ea0b07d5fe4fb4eaf5a90d2801161e4c Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Mon, 1 Mar 2010 21:17:36 +0000 Subject: 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 --- clang/lib/Sema/SemaDecl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'clang/lib/Sema/SemaDecl.cpp') 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); -- cgit v1.2.3