c++/10505: g++ 3.2.1 on sun won't compile obj with list ofobj as member data

tjj@aol.net tjj@aol.net
Fri Apr 25 17:56:00 GMT 2003


>Number:         10505
>Category:       c++
>Synopsis:       g++ 3.2.1 on sun won't compile obj with list ofobj as member data
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 25 17:56:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     tjj@aol.net
>Release:        g++ 3.2.1
>Organization:
>Environment:
SunOS foobar 5.7 Generic_106541-11 sun4u sparc SUNW,Ultra-5_10
>Description:

>How-To-Repeat:
Put following into foo.cc
include <list>

class   Foo
{
public:
    int             x;
    std::list<Foo>  children;
};

then

g++ -c foo.cc

(note: Works fine on Linux x86)
>Fix:
Change std::list<Foo> children to std::list<Foo> *children
and fix code that references it. ugh 
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="foo-error.txt"
Content-Disposition: inline; filename="foo-error.txt"


foobar%	cat foo.cc
#include <list>

class   Foo
{
public:
    int             x;
    std::list<Foo>  children;
};
foobar%	g++ -c  -save-temps foo.cc
/cm/tools/paks/gcc-3.2.1/include/c++/3.2.1/bits/boost_concept_check.h: In instantiation of `__gnu_cxx::_SGIAssignableConcept<Foo>':
/cm/tools/paks/gcc-3.2.1/include/c++/3.2.1/bits/stl_list.h:293:   instantiated from `std::list<Foo, std::allocator<Foo> >'
foo.cc:7:   instantiated from here
/cm/tools/paks/gcc-3.2.1/include/c++/3.2.1/bits/boost_concept_check.h:182: `
   __gnu_cxx::_SGIAssignableConcept<_Tp>::__a' has incomplete type
foo.cc:4: forward declaration of `class Foo'
/cm/tools/paks/gcc-3.2.1/include/c++/3.2.1/bits/boost_concept_check.h: In 
   member function `void __gnu_cxx::_SGIAssignableConcept<_Tp>::__constraints() 
   [with _Tp = Foo]':
/cm/tools/paks/gcc-3.2.1/include/c++/3.2.1/bits/stl_list.h:293:   instantiated from `std::list<Foo, std::allocator<Foo> >'
foo.cc:7:   instantiated from here
/cm/tools/paks/gcc-3.2.1/include/c++/3.2.1/bits/boost_concept_check.h:174: `
   struct __gnu_cxx::_SGIAssignableConcept<Foo>' has no member named `__a'
/cm/tools/paks/gcc-3.2.1/include/c++/3.2.1/bits/stl_list.h:293:   instantiated from `std::list<Foo, std::allocator<Foo> >'
foo.cc:7:   instantiated from here
/cm/tools/paks/gcc-3.2.1/include/c++/3.2.1/bits/boost_concept_check.h:175: `
   struct __gnu_cxx::_SGIAssignableConcept<Foo>' has no member named `__a'
/cm/tools/paks/gcc-3.2.1/include/c++/3.2.1/bits/boost_concept_check.h:175: `
   struct __gnu_cxx::_SGIAssignableConcept<Foo>' has no member named `__a'
/cm/tools/paks/gcc-3.2.1/include/c++/3.2.1/bits/boost_concept_check.h:176: `
   struct __gnu_cxx::_SGIAssignableConcept<Foo>' has no member named `__a'
foobar%	



More information about the Gcc-prs mailing list