[all-commits] [llvm/llvm-project] 506406: [Sema][SVE] Reject "new" with sizeless types

rsandifo-arm via All-commits all-commits at lists.llvm.org
Tue Mar 17 05:24:20 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 506406c4d59267497d4ac358b49e32b4d2f72119
      https://github.com/llvm/llvm-project/commit/506406c4d59267497d4ac358b49e32b4d2f72119
  Author: Richard Sandiford <richard.sandiford at arm.com>
  Date:   2020-03-17 (Tue, 17 Mar 2020)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Sema/SemaExprCXX.cpp
    M clang/test/SemaCXX/sizeless-1.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list