HomePhabricator

[Sema][SVE] Reject "new" with sizeless types

Authored by rsandifo-arm on Mar 3 2020, 3:14 AM.

Description

[Sema][SVE] Reject "new" with sizeless types

new-expressions for a type T require sizeof(T) to be computable,
so the SVE ACLE does not allow them for sizeless types. At the moment:

auto f() { return new __SVInt8_t; }

creates a call to operator new with a zero size:

%call = call noalias nonnull i8* @_Znwm(i64 0)

This patch reports an appropriate error instead.

Differential Revision: https://reviews.llvm.org/D76218