]> 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, 24 Oct 2018 22:38:49 +0000 (22:38 +0000)
committerEric Fiselier <eric@efcs.ca>
Wed, 24 Oct 2018 22:38:49 +0000 (22:38 +0000)
commit6f47cdd51341344c0e32630e19e72c94cd25f34e
tree01dad57f7c57f119615ddd594f8bf4a1cdde85d9
parent087ec178eee519a57d948e10e279c7e5af50f065
[SemaCXX] Unconfuse Clang when std::align_val_t is unscoped in C++03

Summary:
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.

Reviewers: rsmith, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D53508

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