aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-01-26 00:26:18 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-01-26 00:26:18 +0000
commitceccab908bd7824751b1def127272ec04dd4732b (patch)
treec52b2ef8b9090370dedfe59fd55a72db72afcb17 /lib/Sema/SemaExprCXX.cpp
parent26f0e4e7ab534fb42485c930f20a424ecc8c9830 (diff)
Slight refactoring; catch yet another case where we were missing an lvalue-to-rvalue conversion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149003 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprCXX.cpp')
-rw-r--r--lib/Sema/SemaExprCXX.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index 2f8bf77431..ae0c2c58c1 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -995,12 +995,7 @@ Sema::BuildCXXNew(SourceLocation StartLoc, bool UseGlobal,
// C++ 5.3.4p6: "The expression in a direct-new-declarator shall have integral
// or enumeration type with a non-negative value."
if (ArraySize && !ArraySize->isTypeDependent()) {
- ExprResult ConvertedSize = DefaultFunctionArrayLvalueConversion(ArraySize);
- if (ConvertedSize.isInvalid())
- return ExprError();
- ArraySize = ConvertedSize.take();
-
- ConvertedSize = ConvertToIntegralOrEnumerationType(
+ ExprResult ConvertedSize = ConvertToIntegralOrEnumerationType(
StartLoc, ArraySize,
PDiag(diag::err_array_size_not_integral),
PDiag(diag::err_array_size_incomplete_type)