From 0d86e7f1ff34e2249e88ae73497f5aa96ccb9816 Mon Sep 17 00:00:00 2001 From: redi Date: Thu, 23 Aug 2018 19:27:54 +0000 Subject: [PATCH] Fix failure when -fno-rtti test is run in C++17 or later * testsuite/util/testsuite_allocator.h (__gnu_test::memory_resource): Only define when RTTI is enabled. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263820 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/ChangeLog | 3 +++ libstdc++-v3/testsuite/util/testsuite_allocator.h | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index c74cee2148d..53fbb8c5621 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,8 @@ 2018-08-23 Jonathan Wakely + * 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: diff --git a/libstdc++-v3/testsuite/util/testsuite_allocator.h b/libstdc++-v3/testsuite/util/testsuite_allocator.h index 03679aad8dc..b0fecfb59a3 100644 --- a/libstdc++-v3/testsuite/util/testsuite_allocator.h +++ b/libstdc++-v3/testsuite/util/testsuite_allocator.h @@ -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 -- 2.11.4.GIT