[Bug c++/11444] New: [3.3 regression] function fails to propagate up class tree (template-related)

debian-gcc at lists dot debian dot org gcc-bugzilla@gcc.gnu.org
Sun Jul 6 12:53:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: [3.3 regression] function fails to propagate up class
                    tree (template-related)
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: debian-gcc at lists dot debian dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i386-linux
  GCC host triplet: i386-linux
GCC target triplet: i386-linux

forwarded from http://bugs.debian.org/198042]

attached preprocessed source compiles with gcc-3.2.3, fails with 3.3 CVS 20030626

Daniel Stone writes:

I'm trying to build aspseek[1] with gcc3.3, and failing. The problem is
this:
class CPtr<T> {
	doRelease() {
		p->Release();
	}
}
class CStackElem {
	public:
		void Release() { ... }
}
class CSearchExpression : public CStackElem;

The p in CPtr's doRelease is the template given. Now, when running with
CPtr<CSearchExpression> (or CPtr<CWord1> - they're both in the same
boat), Release is allegedly 'undeclared in this context'. It's not
declared up in CSearchExpression (causing a conflict), it's just
undeclared, apparently.

In the sources I have, CPtr::doRelease() is actually CPtr::Release(),
but changing it to doRelease() doesn't help. CPtr does have some
extremely funky operator overloads tho (->, *, etc), so maybe that's
what's causing it. I tried to compress this down to a small testcase,
but unfortunately failed. Myself and Matt Zimmerman tried numerous
methods of squashing this, including declaring Release() explicitly in
CSearchExpression, and more, but failed.

This appears to be a regression, as it builds fine with gcc3.2, and I
can't see how it could be undeclared.

$ g++ -O2 -c qparser.ii In file included from qparser.cpp:24:
../include/ccom.h: In destructor `CPtr<T>::~CPtr() [with T = CSearchExpression]
   ':
/usr/include/c++/3.2/bits/stl_construct.h:125:   instantiated from `void
std::_Destroy(_Tp*) [with _Tp = std::pair<const CUWord, CPtr<CSearchExpression> >]'
/usr/include/c++/3.2/ext/stl_hashtable.h:542:   instantiated from `void
__gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey,
_Alloc>::_M_delete_node(__gnu_cxx::_Hashtable_node<_Val>*) [with _Val =
std::pair<const CUWord, CPtr<CSearchExpression> >, _Key = CUWord, _HashFcn =
__gnu_cxx::hash<CUWord>, _ExtractKey = std::_Select1st<std::pair<const CUWord,
CPtr<CSearchExpression> > >, _EqualKey = std::equal_to<CUWord>, _Alloc =
std::allocator<CPtr<CSearchExpression> >]'
/usr/include/c++/3.2/ext/stl_hashtable.h:953:   instantiated from `void
__gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey,
_Alloc>::clear() [with _Val = std::pair<const CUWord, CPtr<CSearchExpression> >,
_Key = CUWord, _HashFcn = __gnu_cxx::hash<CUWord>, _ExtractKey =
std::_Select1st<std::pair<const CUWord, CPtr<CSearchExpression> > >, _EqualKey =
std::equal_to<CUWord>, _Alloc = std::allocator<CPtr<CSearchExpression> >]'
/usr/include/c++/3.2/ext/stl_hashtable.h:326:   instantiated from
`__gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey,
_Alloc>::~hashtable() [with _Val = std::pair<const CUWord,
CPtr<CSearchExpression> >, _Key = CUWord, _HashFcn = __gnu_cxx::hash<CUWord>,
_ExtractKey = std::_Select1st<std::pair<const CUWord, CPtr<CSearchExpression> >
>, _EqualKey = std::equal_to<CUWord>, _Alloc =
std::allocator<CPtr<CSearchExpression> >]'
../include/qparser.h:94:   instantiated from here
../include/ccom.h:74: error: `Release' undeclared (first use this function)
../include/ccom.h:74: error: (Each undeclared identifier is reported only once 
   for each function it appears in.)
../include/ccom.h: In destructor `CPtr<T>::~CPtr() [with T = CWord1]':
/usr/include/c++/3.2/bits/stl_construct.h:125:   instantiated from `void
std::_Destroy(_Tp*) [with _Tp = std::pair<const CUWord, CPtr<CWord1> >]'
/usr/include/c++/3.2/ext/stl_hashtable.h:542:   instantiated from `void
__gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey,
_Alloc>::_M_delete_node(__gnu_cxx::_Hashtable_node<_Val>*) [with _Val =
std::pair<const CUWord, CPtr<CWord1> >, _Key = CUWord, _HashFcn =
__gnu_cxx::hash<CUWord>, _ExtractKey = std::_Select1st<std::pair<const CUWord,
CPtr<CWord1> > >, _EqualKey = std::equal_to<CUWord>, _Alloc =
std::allocator<CPtr<CWord1> >]'
/usr/include/c++/3.2/ext/stl_hashtable.h:953:   instantiated from `void
__gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey,
_Alloc>::clear() [with _Val = std::pair<const CUWord, CPtr<CWord1> >, _Key =
CUWord, _HashFcn = __gnu_cxx::hash<CUWord>, _ExtractKey =
std::_Select1st<std::pair<const CUWord, CPtr<CWord1> > >, _EqualKey =
std::equal_to<CUWord>, _Alloc = std::allocator<CPtr<CWord1> >]'
/usr/include/c++/3.2/ext/stl_hashtable.h:326:   instantiated from
`__gnu_cxx::hashtable<_Val, _Key, _HashFcn, _ExtractKey, _EqualKey,
_Alloc>::~hashtable() [with _Val = std::pair<const CUWord, CPtr<CWord1> >, _Key
= CUWord, _HashFcn = __gnu_cxx::hash<CUWord>, _ExtractKey =
std::_Select1st<std::pair<const CUWord, CPtr<CWord1> > >, _EqualKey =
std::equal_to<CUWord>, _Alloc = std::allocator<CPtr<CWord1> >]'
../include/qparser.h:94:   instantiated from here
../include/ccom.h:74: error: `Release' undeclared (first use this function)



More information about the Gcc-bugs mailing list