diff options
author | John McCall <rjmccall@apple.com> | 2012-03-09 04:08:29 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2012-03-09 04:08:29 +0000 |
commit | 5aba3eb1be234336767f86c7252ed307255f4d4d (patch) | |
tree | 8bd91c7461acab91a8239d8cdf6b5317def7962d /lib/Sema/SemaExprCXX.cpp | |
parent | 71cba34b6e2d3fb81860bd2176ab7003eaf2e918 (diff) |
Perform l2r conversions on delete operands before doing
type-analysis; otherwise, we just completely do the
wrong thing for placeholders.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152375 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | lib/Sema/SemaExprCXX.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index dca7719894..6c7bdeb742 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/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 |