Fix compilation with Clang
authorJonathan Wakely <jwakely@redhat.com>
Fri, 25 Oct 2019 17:02:35 +0000 (18:02 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 25 Oct 2019 17:02:35 +0000 (18:02 +0100)
commiteadcde8e8f53c950fc17b52fd33adda40d28f7af
tree4d27dc4cf1824e4b37fa393498803ee9a38bf8d8
parent2cd6630fc0218580f29e87ea418d9e435d062412
Fix compilation with Clang

The new constexpr destructor on std::allocator breaks compilation with
Clang in C++2a mode. This only makes it constexpr if the compiler
supports the P0784R7 features.

* include/bits/allocator.h: Check __cpp_constexpr_dynamic_alloc
before making the std::allocator destructor constexpr.
* testsuite/20_util/allocator/requirements/constexpr.cc: New test.

From-SVN: r277458
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/allocator.h
libstdc++-v3/testsuite/20_util/allocator/requirements/constexpr.cc [new file with mode: 0644]