if (CheckAllocatedType(AllocType, TypeRange.getBegin(), TypeRange))
return ExprError();
+ if (ArraySize && !checkArrayElementAlignment(AllocType, TypeRange.getBegin()))
+ return ExprError();
+
// In ARC, infer 'retaining' for the allocated
if (getLangOpts().ObjCAutoRefCount &&
AllocType.getObjCLifetime() == Qualifiers::OCL_None &&
else if (RequireNonAbstractType(Loc, AllocType,
diag::err_allocation_of_abstract_type))
return true;
- else if (!checkArrayElementAlignment(AllocType, Loc))
- return true;
else if (AllocType->isVariablyModifiedType())
return Diag(Loc, diag::err_variably_modified_new_type)
<< AllocType;
auto p3 = new AlignedStruct[1];
auto p4 = (AlignedPackedStruct(*)[1])p; // expected-error {{size of array element}}
auto p5 = new AlignedPackedStruct[1]; // expected-error {{size of array element}}
+ auto p6 = new AlignedPackedStruct;
}