]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix failure when -fno-rtti test is run in C++17 or later
authorJonathan Wakely <jwakely@redhat.com>
Thu, 23 Aug 2018 19:27:54 +0000 (20:27 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 23 Aug 2018 19:27:54 +0000 (20:27 +0100)
* testsuite/util/testsuite_allocator.h (__gnu_test::memory_resource):
Only define when RTTI is enabled.

From-SVN: r263820

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/util/testsuite_allocator.h

index c74cee2148d2187d9be3f26271d513b378a61074..53fbb8c56217dad86baa9aa1c0482b7ba190bf96 100644 (file)
@@ -1,5 +1,8 @@
 2018-08-23  Jonathan Wakely  <jwakely@redhat.com>
 
+       * testsuite/util/testsuite_allocator.h (__gnu_test::memory_resource):
+       Only define when RTTI is enabled.
+
        * include/debug/vector (__niter_base): Define for C++98.
 
        * testsuite/25_algorithms/partial_sort_copy/debug/irreflexive_neg.cc:
index 03679aad8dcd496e514a60fcbc971c3501c1af29..b0fecfb59a31eae1fd37a9f4a2b1a01a965e63b4 100644 (file)
@@ -697,7 +697,8 @@ namespace __gnu_test
     };
 #endif // C++11
 
-#if __cplusplus >= 201703L && __cpp_aligned_new
+#if __cplusplus >= 201703L
+#if __cpp_aligned_new && __cpp_rtti
     // A concrete memory_resource, with error checking.
     class memory_resource : public std::pmr::memory_resource
     {
@@ -835,6 +836,7 @@ namespace __gnu_test
 
       allocation_lists* lists;
     };
+#endif // aligned-new && rtti
 
     // Set the default resource, and restore the previous one on destruction.
     struct default_resource_mgr
@@ -849,7 +851,7 @@ namespace __gnu_test
       std::pmr::memory_resource* prev;
     };
 
-#endif // C++17 && aligned-new
+#endif // C++17
 
 } // namespace __gnu_test