[PATCH] D45013: Generate warning when over-aligned new call is required but not supported.

Eric Fiselier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 28 19:39:52 PDT 2018


EricWF created this revision.
EricWF added reviewers: vsapsai, mclow.lists.
Herald added a subscriber: christof.

Currently libc++ silently ignores over-aligned allocation requests
made through __libcpp_allocate when aligned new/delete is not available.

      

This patch uses the `diagnose_if` attribute to generate a warning in that
case instead of being silent.

      

The change required converting __is_overaligned_for_new to a macro
so that the diagnose_if condition is still a potential constant expression in C++03.


Repository:
  rCXX libc++

https://reviews.llvm.org/D45013

Files:
  include/memory
  include/new
  test/libcxx/utilities/memory/default.allocation/allocator.members/overaligned_new_not_supported.fail.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45013.140178.patch
Type: text/x-patch
Size: 5182 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180329/8fcefe41/attachment-0001.bin>


More information about the cfe-commits mailing list