aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ExprCXX.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-09-14 22:55:20 +0000
committerDouglas Gregor <dgregor@apple.com>2010-09-14 22:55:20 +0000
commit5833b0b831d6afae2885e6af420e2bda639652e6 (patch)
tree9cd679ee2d9b42308f7c88f81f1b1665564a414d /lib/AST/ExprCXX.cpp
parent4178b573b82449c2d888ea1f0957a478534e118c (diff)
When marking the declarations in a default argument expression as
"used", at the time that the default argument itself is used, also mark destructors that will be called by this expression. This fixes a regression that I introduced in r113700, which broke WebKit, and fixes <rdar://problem/8427926>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113883 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprCXX.cpp')
-rw-r--r--lib/AST/ExprCXX.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/AST/ExprCXX.cpp b/lib/AST/ExprCXX.cpp
index a6aeef1ba8..6e73b9cbc2 100644
--- a/lib/AST/ExprCXX.cpp
+++ b/lib/AST/ExprCXX.cpp
@@ -149,6 +149,19 @@ Stmt::child_iterator CXXNewExpr::child_end() {
}
// CXXDeleteExpr
+QualType CXXDeleteExpr::getDestroyedType() const {
+ const Expr *Arg = getArgument();
+ while (const ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(Arg)) {
+ if (ICE->getCastKind() != CK_UserDefinedConversion &&
+ ICE->getType()->isVoidPointerType())
+ Arg = ICE->getSubExpr();
+ else
+ break;
+ }
+
+ return Arg->getType()->getAs<PointerType>()->getPointeeType();
+}
+
Stmt::child_iterator CXXDeleteExpr::child_begin() { return &Argument; }
Stmt::child_iterator CXXDeleteExpr::child_end() { return &Argument+1; }