]> granicus.if.org Git - clang/commit
[SemaCXX] Unconfuse Clang when std::align_val_t is unscoped in C++03
authorEric Fiselier <eric@efcs.ca>
Wed, 16 Jan 2019 02:34:36 +0000 (02:34 +0000)
committerEric Fiselier <eric@efcs.ca>
Wed, 16 Jan 2019 02:34:36 +0000 (02:34 +0000)
commite4f7f71812fa38693c20bc6ea0a157d9811ed058
tree330992214b4788e9723f72c01556571b32cceff0
parent05f206ca4f893bbe2dd01bfe41cefd78f78d1d61
[SemaCXX] Unconfuse Clang when std::align_val_t is unscoped in C++03

When -faligned-allocation is specified in C++03 libc++ defines
std::align_val_t as an unscoped enumeration type (because Clang didn't
provide scoped enumerations as an extension until 8.0).
Unfortunately Clang confuses the `align_val_t` overloads of delete with
the sized deallocation overloads which aren't enabled. This caused Clang
to call the aligned deallocation function as if it were the sized
deallocation overload.

For example: https://godbolt.org/z/xXJELh

This patch fixes the confusion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351294 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaExprCXX.cpp
test/SemaCXX/cxx03-aligned-allocation-unscoped-enum.cpp [new file with mode: 0644]