This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
PATCH: PR middle-end/33199: [4.3 Regression] tr1/2_general_utilities/shared_ptr/assign/auto_ptr.cc
- From: "H.J. Lu" <hjl at lucon dot org>
- To: gcc-patches at gcc dot gnu dot org
- Cc: libstdc++ at gcc dot gnu dot org, rguenther at suse dot de
- Date: Mon, 27 Aug 2007 10:47:38 -0700
- Subject: PATCH: PR middle-end/33199: [4.3 Regression] tr1/2_general_utilities/shared_ptr/assign/auto_ptr.cc
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>&, ...)
{ }