Do not declare std::uses_allocator before C++11
authorJonathan Wakely <jwakely@redhat.com>
Tue, 22 Oct 2019 21:48:53 +0000 (22:48 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 22 Oct 2019 21:48:53 +0000 (22:48 +0100)
* include/bits/memoryfwd.h (uses_allocator): Do not declare for C++98.
* testsuite/17_intro/names.cc: Check uses_allocator in C++98.

From-SVN: r277301

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/memoryfwd.h
libstdc++-v3/testsuite/17_intro/names.cc

index f5d2a0189e4320e4f0dfd6b1346d85b2ba38d8ad..6ffe6fa12b5b56f98696aac0b3524d1d526bce39 100644 (file)
@@ -1,5 +1,8 @@
 2019-10-22  Jonathan Wakely  <jwakely@redhat.com>
 
+       * include/bits/memoryfwd.h (uses_allocator): Do not declare for C++98.
+       * testsuite/17_intro/names.cc: Check uses_allocator in C++98.
+
        * include/bits/alloc_traits.h
        (allocator_traits<allocator<T>>::allocate): Ignore hint for C++20.
        (allocator_traits<allocator<T>>::construct): Perform placement new
index d42eabeceb898b0aacc3f452202bc2070de51477..6542adc1cdd21ca1105d062c0e4b5d932333acd3 100644 (file)
@@ -68,9 +68,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     class allocator<void>;
 #endif
 
+#if __cplusplus >= 201103L
   /// Declare uses_allocator so it can be specialized in \<queue\> etc.
   template<typename, typename>
     struct uses_allocator;
+#endif
 
   /// @} group memory
 
index 3d6148fa0e8d29c64db7dd90b6f4358cdbe2a79a..81a1d6fdf46aba2bc291615613156776cb52bc51 100644 (file)
 
 #define tmp (
 
+#if __cplusplus < 201103L
+#define uses_allocator  (
+#endif
+
 #if __cplusplus < 201703L
 // <charconv> defines to_chars_result::ptr and to_chars_result::ec
 #define ec (