summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2012-03-09 04:08:29 +0000
committerJohn McCall <rjmccall@apple.com>2012-03-09 04:08:29 +0000
commitef4290281647150fdfb4ab531f0bc3622e50e218 (patch)
tree660fe0373f169ea0bdc8c2b68496fe87a870b7d0 /clang/lib/Sema/SemaExprCXX.cpp
parent1c0ec45b671b2d186f565e1a1f08f6a671414564 (diff)
downloadbcm5719-llvm-ef4290281647150fdfb4ab531f0bc3622e50e218.tar.gz
bcm5719-llvm-ef4290281647150fdfb4ab531f0bc3622e50e218.zip
Perform l2r conversions on delete operands before doing
type-analysis; otherwise, we just completely do the wrong thing for placeholders. llvm-svn: 152375
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaExprCXX.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index dca77198946..6c7bdeb7422 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -1972,6 +1972,9 @@ Sema::ActOnCXXDelete(SourceLocation StartLoc, bool UseGlobal,
bool UsualArrayDeleteWantsSize = false;
if (!Ex.get()->isTypeDependent()) {
+ // Perform lvalue-to-rvalue cast, if needed.
+ Ex = DefaultLvalueConversion(Ex.take());
+
QualType Type = Ex.get()->getType();
if (const RecordType *Record = Type->getAs<RecordType>()) {
@@ -2053,9 +2056,6 @@ Sema::ActOnCXXDelete(SourceLocation StartLoc, bool UseGlobal,
}
}
- // Perform lvalue-to-rvalue cast, if needed.
- Ex = DefaultLvalueConversion(Ex.take());
-
// C++ [expr.delete]p2:
// [Note: a pointer to a const type can be the operand of a
// delete-expression; it is not necessary to cast away the constness
OpenPOWER on IntegriCloud