summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclCXX.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-08-18 00:00:49 +0000
committerJohn McCall <rjmccall@apple.com>2009-08-18 00:00:49 +0000
commit5ed6e8f54ce256921afbfd0a7535d9992de80a78 (patch)
treef7304024c15f7b2a54057ae508844f1c66ef3472 /clang/lib/Sema/SemaDeclCXX.cpp
parent26657ea8bc09e205f90d525e3564e235d6fe0d58 (diff)
downloadbcm5719-llvm-5ed6e8f54ce256921afbfd0a7535d9992de80a78.tar.gz
bcm5719-llvm-5ed6e8f54ce256921afbfd0a7535d9992de80a78.zip
Teach Sema how to pop out of friend function definitions in nested classes.
llvm-svn: 79291
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp3
1 files changed, 3 insertions, 0 deletions
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<FriendFunctionDecl>(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
OpenPOWER on IntegriCloud