From 5ed6e8f54ce256921afbfd0a7535d9992de80a78 Mon Sep 17 00:00:00 2001 From: John McCall Date: Tue, 18 Aug 2009 00:00:49 +0000 Subject: Teach Sema how to pop out of friend function definitions in nested classes. llvm-svn: 79291 --- clang/lib/Sema/SemaDeclCXX.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/lib/Sema/SemaDeclCXX.cpp') diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 068978cd926..2de348485e7 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -3590,6 +3590,9 @@ Sema::DeclPtrTy Sema::ActOnFriendDecl(Scope *S, Redeclaration); FD = cast_or_null(ND); + assert(FD->getDeclContext() == DC); + assert(FD->getLexicalDeclContext() == CurContext); + // If this is a dependent context, just add the decl to the // class's decl list and don't both with the lookup tables. This // doesn't affect lookup because any call that might find this -- cgit v1.2.3