[PATCH] D34574: [Sema] Disable c++17 aligned new and delete operators if not implemented in the deployment target's c++ standard library

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 28 19:21:59 PDT 2017


ahatanak updated this revision to Diff 104579.
ahatanak added a comment.

The updated patch produces diagnostics if an aligned allocation function is selected that is not implemented in the c++ standard library of the deployment target (except when the function is defined by the user and its definition is available).

A couple of points I'd like to address about the approach I took:

- The only way to silence the warning is to use -Wno-aligned-allocation-unavailable, as is mentioned in the note. I initially considered using -faligned-allocation for that purpose, but I realized it would silence errors/warnings when using "-std=c++14 -faligned-allocation", which is not desirable unless the selected aligned functions are defined by the user.

- isReplaceableGlobalAllocationFunction takes a pointer to a bool, but it's also possible to have it return a pair of bools.


https://reviews.llvm.org/D34574

Files:
  include/clang/AST/Decl.h
  include/clang/Basic/DiagnosticGroups.td
  include/clang/Basic/DiagnosticSemaKinds.td
  include/clang/Basic/LangOptions.def
  include/clang/Driver/CC1Options.td
  lib/AST/Decl.cpp
  lib/Driver/ToolChains/Darwin.cpp
  lib/Driver/ToolChains/Darwin.h
  lib/Frontend/CompilerInvocation.cpp
  lib/Sema/SemaExprCXX.cpp
  test/Driver/unavailable_aligned_allocation.cpp
  test/SemaCXX/unavailable_aligned_allocation.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34574.104579.patch
Type: text/x-patch
Size: 17044 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170629/0b391d16/attachment.bin>


More information about the cfe-commits mailing list