PATCH: PR middle-end/33199: [4.3 Regression] tr1/2_general_utilities/shared_ptr/assign/auto_ptr.cc

H.J. Lu hjl@lucon.org
Mon Aug 27 17:47:00 GMT 2007


The problem is C++ can't inline a function with a variable-length
argument list. Before revision 127763, we ignore inline on C++
functions with a variable-length argument list. But now, we
inline C++ functions with a variable-length argument list,
which generates incorrect codes. I don't know what the appropriate
fix is. If inline isn't allowed here, compiler should issue an
error instead of generating wrong code unless we can ignore inline
like what we did before revision 127763.


H.J.
----
2007-08-27  H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/33199
	* include/tr1_impl/boost_shared_ptr.h
	(std::tr1::__enable_shared_from_this_helper): Don't inline
	the one with a variable-length argument list.

Index: libstdc++-v3/include/tr1_impl/boost_shared_ptr.h
===================================================================
--- libstdc++-v3/include/tr1_impl/boost_shared_ptr.h	(revision 127763)
+++ libstdc++-v3/include/tr1_impl/boost_shared_ptr.h	(working copy)
@@ -478,7 +478,9 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
 				     const _Tp2*);
 
   template<_Lock_policy _Lp>
-    inline void
+    // FIXME: We can't inline a function with a variable-length
+    // argument list.
+    void
     __enable_shared_from_this_helper(const __shared_count<_Lp>&, ...)
     { }
 



More information about the Libstdc++ mailing list