From ffef1e30a7775eb54309de258c60f7da794c0a72 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Mon, 3 Jun 2019 23:18:31 +0100 Subject: [PATCH] Fix uses of static_assert not guarded by C++11 check * include/bits/stl_map.h (map): Disable static assert for C++98 mode. * include/bits/stl_multimap.h (multimap): Likewise. From-SVN: r271884 --- libstdc++-v3/ChangeLog | 5 +++++ libstdc++-v3/include/bits/stl_map.h | 2 ++ libstdc++-v3/include/bits/stl_multimap.h | 2 ++ 3 files changed, 9 insertions(+) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 5a7054e3aeb..a1cd084855f 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2019-06-03 Jonathan Wakely + + * include/bits/stl_map.h (map): Disable static assert for C++98 mode. + * include/bits/stl_multimap.h (multimap): Likewise. + 2019-06-03 François Dumont Rename variables and cleanup comments. diff --git a/libstdc++-v3/include/bits/stl_map.h b/libstdc++-v3/include/bits/stl_map.h index b1083d572d6..097f5afaf26 100644 --- a/libstdc++-v3/include/bits/stl_map.h +++ b/libstdc++-v3/include/bits/stl_map.h @@ -118,9 +118,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER __glibcxx_class_requires2(value_type, _Alloc_value_type, _SameTypeConcept) #endif +#if __cplusplus >= 201103L #if __cplusplus > 201703L || defined __STRICT_ANSI__ static_assert(is_same::value, "std::map must have the same value_type as its allocator"); +#endif #endif public: diff --git a/libstdc++-v3/include/bits/stl_multimap.h b/libstdc++-v3/include/bits/stl_multimap.h index bb4aece96bf..0b53ddab96c 100644 --- a/libstdc++-v3/include/bits/stl_multimap.h +++ b/libstdc++-v3/include/bits/stl_multimap.h @@ -117,9 +117,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER __glibcxx_class_requires2(value_type, _Alloc_value_type, _SameTypeConcept) #endif +#if __cplusplus >= 201103L #if __cplusplus > 201703L || defined __STRICT_ANSI__ static_assert(is_same::value, "std::multimap must have the same value_type as its allocator"); +#endif #endif public: -- 2.30.2