On 29/10/19 10:23 +0100, Stephan Bergmann wrote:
On 23/10/2019 21:27, Jonathan Wakely wrote:
This patch is the first part of library support for constexpr
std::vector and std::string. This only includes the changes to
std::allocator, std::allocator_traits, std::construct_at,
std::destroy_at, std::destroy and std::destroy_n.
[...]
Tested x86_64-linux and powerpc64le-linux, for every -std=gnu++NN
mode.

Clang (trunk, at least) with -std=c++11 now complains about some of the constexpr (because they return void, or don't have a return statement) when including <memory>.

Ah, thanks for letting me know. I did test with Clang, but not with
-std=c++11. I'll add that to my set of checks.

What fixed it for me locally:

diff --git a/libstdc++-v3/include/bits/alloc_traits.h 
b/libstdc++-v3/include/bits/alloc_traits.h
index 26d6d26ae48..61d3c1b794b 100644
--- a/libstdc++-v3/include/bits/alloc_traits.h
+++ b/libstdc++-v3/include/bits/alloc_traits.h
@@ -241,13 +241,20 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
          = typename __construct_helper<_Tp, _Args...>::type;
      template<typename _Tp, typename... _Args>
-       static constexpr _Require<__has_construct<_Tp, _Args...>>
+       static
+#if __cplusplus >= 201402L
+              constexpr
+#endif

That's what the _GLIBCXX14_CONSTEXPR macro is for.

I'll fix this today, thanks.

Reply via email to