public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14528] New: Regression compiling Boost.Python test
@ 2004-03-11 10:40 rwgk at yahoo dot com
  2004-03-11 10:44 ` [Bug c++/14528] " rwgk at yahoo dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: rwgk at yahoo dot com @ 2004-03-11 10:40 UTC (permalink / raw)
  To: gcc-bugs

gcc-3_4-branch from 2004/03/11, 01:01am PST
Configured with: /net/worm/scratch1/rwgk/gcc-3_4-branch/configure --
prefix=/usr/local_cci/gcc-3_4-branch_2004_03_11 --enable-languages=c,c++
Redhat Linux 8.0
Boost CVS from 2004/03/10, 13:06 PST

% g++ -fPIC -ftemplate-depth-120 -w -DNDEBUG -O3 -ffast-math -
DBOOST_PYTHON_MAX_BASES=2 -I/net/worm/scratch1/rwgk/hot/boost -
I/usr/include/python2.2 -
E /net/worm/scratch1/rwgk/hot/boost/libs/python/test/auto_ptr.cpp > 
auto_ptr_pp.cpp

% g++ -fPIC -ftemplate-depth-120 -w -O3 -ffast-math -c auto_ptr_pp.cpp

/net/worm/scratch1/rwgk/hot/boost/boost/python/detail/invoke.hpp: In function 
`PyObject* boost::python::detail::invoke(boost::python::detail::invoke_tag_< 
false,  false>, const RC&, F&, AC0&) [with RC = 
boost::python::to_python_value<const std::auto_ptr<X>&>, F = std::auto_ptr<X> 
(*)(boost::python::api::object), AC0 = 
boost::python::arg_from_python<boost::python::api::object>]':
/net/worm/scratch1/rwgk/hot/boost/boost/python/detail/caller.hpp:199:   
instantiated from `PyObject* boost::python::detail::caller_arity<1u>::impl<F, 
Policies, Sig>::operator()(PyObject*, PyObject*) [with F = std::auto_ptr<X> (*)
(boost::python::api::object), Policies = boost::python::default_call_policies, 
Sig = boost::mpl::vector2<std::auto_ptr<X>, boost::python::api::object>]'
/net/worm/scratch1/rwgk/hot/boost/boost/python/object/py_function.hpp:39:   
instantiated from `PyObject* 
boost::python::objects::caller_py_function_impl<Caller>::operator()(PyObject*, 
PyObject*) [with Caller = boost::python::detail::caller<std::auto_ptr<X> (*)
(boost::python::api::object), boost::python::default_call_policies, 
boost::mpl::vector2<std::auto_ptr<X>, boost::python::api::object> >]'
/net/worm/scratch1/rwgk/hot/boost/libs/python/test/auto_ptr.cpp:90:   
instantiated from here
/net/worm/scratch1/rwgk/hot/boost/boost/python/detail/invoke.hpp:76: error: 
passing `const std::auto_ptr<X>' as `this' argument of 
`std::auto_ptr<_Tp>::operator std::auto_ptr_ref<_Tp1>() [with _Tp1 = X, _Tp = 
X]' discards qualifiers
/net/worm/scratch1/rwgk/hot/boost/boost/python/detail/invoke.hpp: In function 
`PyObject* boost::python::detail::invoke(boost::python::detail::invoke_tag_< 
false,  false>, const RC&, F&) [with RC = boost::python::to_python_value<const 
std::auto_ptr<X>&>, F = std::auto_ptr<X> (*)()]':
/net/worm/scratch1/rwgk/hot/boost/boost/python/detail/caller.hpp:199:   
instantiated from `PyObject* boost::python::detail::caller_arity<0u>::impl<F, 
Policies, Sig>::operator()(PyObject*, PyObject*) [with F = std::auto_ptr<X> (*)
(), Policies = boost::python::default_call_policies, Sig = 
boost::mpl::vector1<std::auto_ptr<X> >]'
/net/worm/scratch1/rwgk/hot/boost/boost/python/object/py_function.hpp:39:   
instantiated from `PyObject* 
boost::python::objects::caller_py_function_impl<Caller>::operator()(PyObject*, 
PyObject*) [with Caller = boost::python::detail::caller<std::auto_ptr<X> (*)(), 
boost::python::default_call_policies, boost::mpl::vector1<std::auto_ptr<X> > >]'
/net/worm/scratch1/rwgk/hot/boost/libs/python/test/auto_ptr.cpp:90:   
instantiated from here
/net/worm/scratch1/rwgk/hot/boost/boost/python/detail/invoke.hpp:76: error: 
passing `const std::auto_ptr<X>' as `this' argument of 
`std::auto_ptr<_Tp>::operator std::auto_ptr_ref<_Tp1>() [with _Tp1 = X, _Tp = 
X]' discards qualifiers

The same code compiles with g++ (GCC) 3.4.0 20040220(prerelease) and many 
other compilers.

I will attach the preprocessed source code. The same file is also available 
here:

http://cci.lbl.gov/~rwgk/bugs/gcc340/auto_ptr_pp.cpp.gz

-- 
           Summary: Regression compiling Boost.Python test
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rwgk at yahoo dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14528


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/14528] Regression compiling Boost.Python test
  2004-03-11 10:40 [Bug c++/14528] New: Regression compiling Boost.Python test rwgk at yahoo dot com
@ 2004-03-11 10:44 ` rwgk at yahoo dot com
  2004-03-11 16:33 ` [Bug c++/14528] [3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rwgk at yahoo dot com @ 2004-03-11 10:44 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rwgk at yahoo dot com  2004-03-11 10:44 -------
Created an attachment (id=5898)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5898&action=view)
Preprocessed source, gzipped


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14528


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/14528] [3.4/3.5 Regression] compiling Boost.Python test
  2004-03-11 10:40 [Bug c++/14528] New: Regression compiling Boost.Python test rwgk at yahoo dot com
  2004-03-11 10:44 ` [Bug c++/14528] " rwgk at yahoo dot com
@ 2004-03-11 16:33 ` pinskia at gcc dot gnu dot org
  2004-03-11 17:13 ` bangerth at dealii dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-11 16:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-11 16:33 -------
I do not know if this is valid code, to me the error looks corrects but I did not follow through the steps 
of the error.
It worked in 3.5.0 (20040304) but not in 3.5.0 (20040311).

The two patch which might cause this is:
2004-03-10  Mark Mitchell  <mark@codesourcery.com>

        PR c++/14510
        * decl.c (xref_tag): Disregard non-type declarations when
        looking up a tagged type.
2004-03-09  Giovanni Bajo  <giovannibajo@gcc.gnu.org>

        PR c++/14409
        * pt.c (determine_specialization): For member templates, match also
        constness.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |3.4.0 3.5.0
      Known to work|                            |3.3.3
            Summary|Regression compiling        |[3.4/3.5 Regression]
                   |Boost.Python test           |compiling Boost.Python test
   Target Milestone|---                         |3.4.1


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14528


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/14528] [3.4/3.5 Regression] compiling Boost.Python test
  2004-03-11 10:40 [Bug c++/14528] New: Regression compiling Boost.Python test rwgk at yahoo dot com
  2004-03-11 10:44 ` [Bug c++/14528] " rwgk at yahoo dot com
  2004-03-11 16:33 ` [Bug c++/14528] [3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
@ 2004-03-11 17:13 ` bangerth at dealii dot org
  2004-03-11 17:39 ` reichelt at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: bangerth at dealii dot org @ 2004-03-11 17:13 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-03-11 17:13 -------
It still worked on 20040307 on both 3.4 and mainline. 
W. 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14528


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/14528] [3.4/3.5 Regression] compiling Boost.Python test
  2004-03-11 10:40 [Bug c++/14528] New: Regression compiling Boost.Python test rwgk at yahoo dot com
                   ` (2 preceding siblings ...)
  2004-03-11 17:13 ` bangerth at dealii dot org
@ 2004-03-11 17:39 ` reichelt at gcc dot gnu dot org
  2004-03-12  3:18 ` giovannibajo at libero dot it
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-03-11 17:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From reichelt at gcc dot gnu dot org  2004-03-11 17:39 -------
Andrew's guesses were wrong, the error actually appeared with
Nathan's patch for PR 14397:

http://gcc.gnu.org/ml/gcc-cvs/2004-03/msg00456.html (3.4-branch)
http://gcc.gnu.org/ml/gcc-cvs/2004-03/msg00458.html (mainline)


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |reichelt at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14528


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/14528] [3.4/3.5 Regression] compiling Boost.Python test
  2004-03-11 10:40 [Bug c++/14528] New: Regression compiling Boost.Python test rwgk at yahoo dot com
                   ` (3 preceding siblings ...)
  2004-03-11 17:39 ` reichelt at gcc dot gnu dot org
@ 2004-03-12  3:18 ` giovannibajo at libero dot it
  2004-03-12  9:21 ` [Bug libstdc++/14528] [3.4/3.5 Regression] trouble with auto_ptr reichelt at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: giovannibajo at libero dot it @ 2004-03-12  3:18 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-03-12 03:18 -------
We need a redux for this, anybody can help? I don't have time in these days.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14528


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libstdc++/14528] [3.4/3.5 Regression] trouble with auto_ptr
  2004-03-11 10:40 [Bug c++/14528] New: Regression compiling Boost.Python test rwgk at yahoo dot com
                   ` (4 preceding siblings ...)
  2004-03-12  3:18 ` giovannibajo at libero dot it
@ 2004-03-12  9:21 ` reichelt at gcc dot gnu dot org
  2004-03-12 16:11 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-03-12  9:21 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From reichelt at gcc dot gnu dot org  2004-03-12 09:21 -------
The problem is basically an auto_ptr problem which can be demonstrated
with the following code snippet:

==============================================================================
#include<memory>

typedef const std::auto_ptr<int> A;

void foo(const A&);

A makeA();

void bar()
{
    A a; foo(a);  // OK
    foo(A());     // error
    foo(makeA()); // error - the same as in line 45994 of the original example
}
==============================================================================

The problem is, that you need a copy for the temporary (which can be
eliminated, but in theory you need it). With the current implementation
of auto_ptr this is not supplied.

I don't know whether this is correct or a flaw in our auto_ptr
implementation, or even a flaw in the standard. (See PR 14254/3247
for a related issue that came up with stricter checking of the temporary.)

Can a libstdc++ guru provide some insight, please?


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |libstdc++
            Summary|[3.4/3.5 Regression]        |[3.4/3.5 Regression] trouble
                   |compiling Boost.Python test |with auto_ptr


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14528


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libstdc++/14528] [3.4/3.5 Regression] trouble with auto_ptr
  2004-03-11 10:40 [Bug c++/14528] New: Regression compiling Boost.Python test rwgk at yahoo dot com
                   ` (5 preceding siblings ...)
  2004-03-12  9:21 ` [Bug libstdc++/14528] [3.4/3.5 Regression] trouble with auto_ptr reichelt at gcc dot gnu dot org
@ 2004-03-12 16:11 ` pinskia at gcc dot gnu dot org
  2004-03-12 16:19 ` pcarlini at suse dot de
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-12 16:11 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-03-12 16:11 -------
ICC 6.0 gives:

pr14528.cc(12): warning #377: class "std::auto_ptr<int>" has no suitable copy constructor
      foo(A());     // error
          ^

pr14528.cc(13): warning #377: class "std::auto_ptr<int>" has no suitable copy constructor
      foo(makeA()); // error - the same as in line 45994 of the original example
          ^

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14528


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libstdc++/14528] [3.4/3.5 Regression] trouble with auto_ptr
  2004-03-11 10:40 [Bug c++/14528] New: Regression compiling Boost.Python test rwgk at yahoo dot com
                   ` (6 preceding siblings ...)
  2004-03-12 16:11 ` pinskia at gcc dot gnu dot org
@ 2004-03-12 16:19 ` pcarlini at suse dot de
  2004-03-12 21:46 ` rwgk at yahoo dot com
  2004-03-12 21:50 ` bangerth at dealii dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pcarlini at suse dot de @ 2004-03-12 16:19 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2004-03-12 16:19 -------
Yes, Andrew, same for Icc8 (but only in -strict_ansi mode)

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14528


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libstdc++/14528] [3.4/3.5 Regression] trouble with auto_ptr
  2004-03-11 10:40 [Bug c++/14528] New: Regression compiling Boost.Python test rwgk at yahoo dot com
                   ` (7 preceding siblings ...)
  2004-03-12 16:19 ` pcarlini at suse dot de
@ 2004-03-12 21:46 ` rwgk at yahoo dot com
  2004-03-12 21:50 ` bangerth at dealii dot org
  9 siblings, 0 replies; 11+ messages in thread
From: rwgk at yahoo dot com @ 2004-03-12 21:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rwgk at yahoo dot com  2004-03-12 21:46 -------
(In reply to comment #2)
> I do not know if this is valid code, to me the error looks corrects

When I saw this response I alerted David Abrahams (major author of boost) to 
this PR. He had a close look at the issue and came to the conclusion that the 
latest gcc 3.4 is right! He wasn't forthcoming with details leading to the 
conclusion, but the most recent boost CVS is already patched to eliminate the 
error.

Sorry that we didn't catch this earlier; however it is quite unusual to see a 
new but correct error message for code that compiles with so many other 
compilers, including gcc 3.4 from 10 days ago.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14528


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug libstdc++/14528] [3.4/3.5 Regression] trouble with auto_ptr
  2004-03-11 10:40 [Bug c++/14528] New: Regression compiling Boost.Python test rwgk at yahoo dot com
                   ` (8 preceding siblings ...)
  2004-03-12 21:46 ` rwgk at yahoo dot com
@ 2004-03-12 21:50 ` bangerth at dealii dot org
  9 siblings, 0 replies; 11+ messages in thread
From: bangerth at dealii dot org @ 2004-03-12 21:50 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-03-12 21:50 -------
The point is that we generate a temporary for which the standard 
prescribes that a copy constructor must be accessible. We do not have 
to use it, and in fact don't and never did, and as it seems other compilers 
don't as well. However, the compiler needs to still check that the copy 
constructor is in fact accessible, something that we have apparently 
not done up to now. 
 
In other words, the change in the compiler will not lead to different 
code for valid programs, we just check a few more things. In this case 
boost got tripped by that. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14528


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2004-03-12 21:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-11 10:40 [Bug c++/14528] New: Regression compiling Boost.Python test rwgk at yahoo dot com
2004-03-11 10:44 ` [Bug c++/14528] " rwgk at yahoo dot com
2004-03-11 16:33 ` [Bug c++/14528] [3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
2004-03-11 17:13 ` bangerth at dealii dot org
2004-03-11 17:39 ` reichelt at gcc dot gnu dot org
2004-03-12  3:18 ` giovannibajo at libero dot it
2004-03-12  9:21 ` [Bug libstdc++/14528] [3.4/3.5 Regression] trouble with auto_ptr reichelt at gcc dot gnu dot org
2004-03-12 16:11 ` pinskia at gcc dot gnu dot org
2004-03-12 16:19 ` pcarlini at suse dot de
2004-03-12 21:46 ` rwgk at yahoo dot com
2004-03-12 21:50 ` bangerth at dealii dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).