[cfe-commits] r99559 - in /cfe/trunk: lib/Sema/SemaDecl.cpp test/CXX/class.access/p4.cpp
John McCall
rjmccall at apple.com
Thu Mar 25 15:08:03 PDT 2010
Author: rjmccall
Date: Thu Mar 25 17:08:03 2010
New Revision: 99559
URL: http://llvm.org/viewvc/llvm-project?rev=99559&view=rev
Log:
When finishing a function definition, leave the function definition *after*
doing all the cleanup tasks and checks. This gives us the proper context for
checking access to base and member destructors.
Modified:
cfe/trunk/lib/Sema/SemaDecl.cpp
cfe/trunk/test/CXX/class.access/p4.cpp
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=99559&r1=99558&r2=99559&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Thu Mar 25 17:08:03 2010
@@ -4336,8 +4336,6 @@
Body->Destroy(Context);
return DeclPtrTy();
}
- if (!IsInstantiation)
- PopDeclContext();
// Verify and clean out per-function state.
@@ -4419,6 +4417,9 @@
assert(ExprTemporaries.empty() && "Leftover temporaries in function");
}
+ if (!IsInstantiation)
+ PopDeclContext();
+
PopFunctionOrBlockScope();
// If any errors have occurred, clear out any temporaries that may have
Modified: cfe/trunk/test/CXX/class.access/p4.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/class.access/p4.cpp?rev=99559&r1=99558&r2=99559&view=diff
==============================================================================
--- cfe/trunk/test/CXX/class.access/p4.cpp (original)
+++ cfe/trunk/test/CXX/class.access/p4.cpp Thu Mar 25 17:08:03 2010
@@ -283,3 +283,15 @@
};
};
}
+
+namespace test11 {
+ class A {
+ protected: virtual ~A();
+ };
+
+ class B : public A {
+ ~B();
+ };
+
+ B::~B() {};
+}
More information about the cfe-commits
mailing list