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
This commit is contained in:
Jonathan Wakely 2019-06-03 23:18:31 +01:00 committed by Jonathan Wakely
parent fdb1849a6c
commit ffef1e30a7
3 changed files with 9 additions and 0 deletions

View 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.

View 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:

View 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: