From: redi Date: Thu, 23 Aug 2018 15:23:31 +0000 (+0000) Subject: Define debug mode function for C++98 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8715a8ff5f11cd68d714eb29182b23a74ca4df37;p=thirdparty%2Fgcc.git Define debug mode function for C++98 This function is declared unconditionally but was only defined for C++11 and later, leading to linker errors when the testsuite was run with -std=gnu++98 -D_GLIBCXX_DEBUG added to the flags. * include/debug/vector (__niter_base): Define for C++98. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263816 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 9d579baa2049..c74cee2148d2 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,7 @@ 2018-08-23 Jonathan Wakely + * include/debug/vector (__niter_base): Define for C++98. + * testsuite/25_algorithms/partial_sort_copy/debug/irreflexive_neg.cc: Fix C++98 test to not use C++11 features. * testsuite/25_algorithms/fill_n/2.cc: Likewise. diff --git a/libstdc++-v3/include/debug/vector b/libstdc++-v3/include/debug/vector index bd09b2414fc8..e8d0928c7c07 100644 --- a/libstdc++-v3/include/debug/vector +++ b/libstdc++-v3/include/debug/vector @@ -774,9 +774,9 @@ namespace __debug } // namespace __debug -#if __cplusplus >= 201103L _GLIBCXX_BEGIN_NAMESPACE_VERSION +#if __cplusplus >= 201103L // DR 1182. /// std::hash specialization for vector. template @@ -787,6 +787,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator()(const __debug::vector& __b) const noexcept { return std::hash<_GLIBCXX_STD_C::vector>()(__b); } }; +#endif template _Iterator @@ -796,8 +797,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return std::__niter_base(__it.base()); } _GLIBCXX_END_NAMESPACE_VERSION -#endif - } // namespace std namespace __gnu_debug