aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2019-06-03 23:18:31 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2019-06-03 23:18:31 +0100
commitffef1e30a7775eb54309de258c60f7da794c0a72 (patch)
treed81239aa8ea4ad48199c96005e7127cc622df55c
parentfdb1849a6c1b79d9684947c0e40aff6136ab329b (diff)
downloadgcc-ffef1e30a7775eb54309de258c60f7da794c0a72.zip
gcc-ffef1e30a7775eb54309de258c60f7da794c0a72.tar.gz
gcc-ffef1e30a7775eb54309de258c60f7da794c0a72.tar.bz2
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
-rw-r--r--libstdc++-v3/ChangeLog5
-rw-r--r--libstdc++-v3/include/bits/stl_map.h2
-rw-r--r--libstdc++-v3/include/bits/stl_multimap.h2
3 files changed, 9 insertions, 0 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 5a7054e..a1cd084 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -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.
diff --git a/libstdc++-v3/include/bits/stl_map.h b/libstdc++-v3/include/bits/stl_map.h
index b1083d5..097f5af 100644
--- a/libstdc++-v3/include/bits/stl_map.h
+++ b/libstdc++-v3/include/bits/stl_map.h
@@ -118,10 +118,12 @@ _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:
class value_compare
diff --git a/libstdc++-v3/include/bits/stl_multimap.h b/libstdc++-v3/include/bits/stl_multimap.h
index bb4aece..0b53dda 100644
--- a/libstdc++-v3/include/bits/stl_multimap.h
+++ b/libstdc++-v3/include/bits/stl_multimap.h
@@ -117,10 +117,12 @@ _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:
class value_compare