Page MenuHomePhabricator

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

Authored by rsandifo-arm on Mar 16 2020, 2:54 AM.

Details

Summary

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.

Diff Detail

Event Timeline

rsandifo-arm created this revision.Mar 16 2020, 2:54 AM
Herald added a project: Restricted Project. · View Herald Transcript
This revision is now accepted and ready to land.Mar 16 2020, 10:38 AM
This revision was automatically updated to reflect the committed changes.