Fix uses of static_assert not guarded by C++11 check
authorJonathan Wakely <jwakely@redhat.com>
Mon, 3 Jun 2019 22:18:31 +0000 (23:18 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 3 Jun 2019 22:18:31 +0000 (23:18 +0100)
* 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
libstdc++-v3/include/bits/stl_map.h
libstdc++-v3/include/bits/stl_multimap.h

index 5a7054e3aeb6c337b0f051b6c54400f8d48a31fd..a1cd084855fd2ec07facf1fceb2bfa21dd49a224 100644 (file)
@@ -1,3 +1,8 @@
+2019-06-03  Jonathan Wakely  <jwakely@redhat.com>
+
+       * 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  <fdumont@gcc.gnu.org>
 
        Rename variables and cleanup comments.
index b1083d572d6a1f6462692b48131ac0a1aff2a492..097f5afaf2683ff18e5d8184fb3ea1fcf8833ed1 100644 (file)
@@ -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<typename _Alloc::value_type, value_type>::value,
          "std::map must have the same value_type as its allocator");
+#endif
 #endif
 
     public:
index bb4aece96bf61060d93832a3a3f81535043eac11..0b53ddab96cb9d5d16697f12c28899bb57057ea5 100644 (file)
@@ -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<typename _Alloc::value_type, value_type>::value,
          "std::multimap must have the same value_type as its allocator");
+#endif
 #endif
 
     public: