This is an archive of the discontinued LLVM Phabricator instance.

[SemaCXX] Unconfuse Clang when std::align_val_t is unscoped in C++03
ClosedPublic

Authored by EricWF on Oct 22 2018, 9:15 AM.

Details

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.

Diff Detail

Repository
rC Clang

Event Timeline

EricWF created this revision.Oct 22 2018, 9:15 AM
EricWF accepted this revision.Oct 24 2018, 3:39 PM

Accepting. This is a good candidate for post-commit review.

This revision is now accepted and ready to land.Oct 24 2018, 3:39 PM
This revision was automatically updated to reflect the committed changes.