[cfe-commits] r116399 - /cfe/trunk/lib/Sema/SemaDeclCXX.cpp

John McCall rjmccall at apple.com
Tue Oct 12 23:22:15 PDT 2010


Author: rjmccall
Date: Wed Oct 13 01:22:15 2010
New Revision: 116399

URL: http://llvm.org/viewvc/llvm-project?rev=116399&view=rev
Log:
Preserve the original scope when picking the right scope for a friend
declaration, because we'll need it later.  Hopefully fixed self-host.


Modified:
    cfe/trunk/lib/Sema/SemaDeclCXX.cpp

Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=116399&r1=116398&r2=116399&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Wed Oct 13 01:22:15 2010
@@ -6337,6 +6337,7 @@
   // The context we found the declaration in, or in which we should
   // create the declaration.
   DeclContext *DC;
+  Scope *DCScope = S;
   LookupResult Previous(*this, NameInfo, LookupOrdinaryName,
                         ForRedeclaration);
 
@@ -6395,7 +6396,7 @@
         && !getLangOptions().CPlusPlus0x)
       Diag(DS.getFriendSpecLoc(), diag::err_friend_is_member);
 
-    S = getScopeForDeclContext(S, DC);
+    DCScope = getScopeForDeclContext(S, DC);
 
   //   - There's a non-dependent scope specifier, in which case we
   //     compute it and do a previous lookup there for a function
@@ -6454,7 +6455,7 @@
   }
 
   bool Redeclaration = false;
-  NamedDecl *ND = ActOnFunctionDeclarator(S, D, DC, T, TInfo, Previous,
+  NamedDecl *ND = ActOnFunctionDeclarator(DCScope, D, DC, T, TInfo, Previous,
                                           move(TemplateParams),
                                           IsDefinition,
                                           Redeclaration);





More information about the cfe-commits mailing list