|
@@ -1660,9 +1660,9 @@ Sema::ActOnCXXNew(SourceLocation StartLoc, bool UseGlobal,
|
|
|
if (Expr *NumElts = (Expr *)Array.NumElts) {
|
|
|
if (!NumElts->isTypeDependent() && !NumElts->isValueDependent()) {
|
|
|
if (getLangOpts().CPlusPlus14) {
|
|
|
- // C++1y [expr.new]p6: Every constant-expression in a noptr-new-declarator
|
|
|
- // shall be a converted constant expression (5.19) of type std::size_t
|
|
|
- // and shall evaluate to a strictly positive value.
|
|
|
+ // C++1y [expr.new]p6: Every constant-expression in a noptr-new-declarator
|
|
|
+ // shall be a converted constant expression (5.19) of type std::size_t
|
|
|
+ // and shall evaluate to a strictly positive value.
|
|
|
unsigned IntWidth = Context.getTargetInfo().getIntWidth();
|
|
|
assert(IntWidth && "Builtin type of size 0?");
|
|
|
llvm::APSInt Value(IntWidth);
|
|
@@ -1893,7 +1893,7 @@ Sema::BuildCXXNew(SourceRange Range, bool UseGlobal,
|
|
|
assert(Context.getTargetInfo().getIntWidth() && "Builtin type of size 0?");
|
|
|
|
|
|
ConvertedSize = PerformImplicitConversion(ArraySize, Context.getSizeType(),
|
|
|
- AA_Converting);
|
|
|
+ AA_Converting);
|
|
|
|
|
|
if (!ConvertedSize.isInvalid() &&
|
|
|
ArraySize->getType()->getAs<RecordType>())
|