PATCH: PR libstdc++/37144: Type mismatch in libstdc++ testsuite

H.J. Lu hjl.tools@gmail.com
Fri Dec 12 15:42:00 GMT 2008


There is a type mismatch in libstdc++ testsuite.  As the result,
libstdc++ test returns a reference to a variable on stack, which
leads to random run-time failure.  Tested on Linux/ia32, Linux/x86-64
and Linux/ia64.  OK for trunk and 4.3?

Thanks.


H.J.
---
2008-12-11  H.J. Lu  <hongjiu.lu@intel.com>

	PR libstdc++/37144
	* testsuite/util/regression/trait/assoc/type_trait.hpp
	(regression_test_type_traits): Add const to pair_type_rebind.

Index: libstdc++-v3/testsuite/util/regression/trait/assoc/type_trait.hpp
===================================================================
--- libstdc++-v3/testsuite/util/regression/trait/assoc/type_trait.hpp	(revision 142654)
+++ libstdc++-v3/testsuite/util/regression/trait/assoc/type_trait.hpp	(working copy)
@@ -87,7 +87,7 @@ namespace __gnu_pbds
 	
 	typedef typename basic_type_rebind::const_reference basic_type_const_reference;
 
-	typedef typename cntnr::allocator_type::template rebind<std::pair<basic_type, basic_type> >::other pair_type_rebind;
+	typedef typename cntnr::allocator_type::template rebind<std::pair<const basic_type, basic_type> >::other pair_type_rebind;
 	typedef typename pair_type_rebind::const_reference pair_type_const_reference;
 
 	template<typename Gen>



More information about the Gcc-patches mailing list