Bug 11444 - [3.3/3.4 regression] function fails to propagate up class tree (template-related)
Summary: [3.3/3.4 regression] function fails to propagate up class tree (template-rela...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.3.1
: P2 critical
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-06 12:53 UTC by Debian GCC Maintainers
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host: i386-linux
Target: i386-linux
Build: i386-linux
Known to work:
Known to fail:
Last reconfirmed:


Attachments
preprocessed source (99.07 KB, application/gzip)
2003-07-06 12:54 UTC, Debian GCC Maintainers
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Debian GCC Maintainers 2003-07-06 12:53:11 UTC
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)
Comment 1 Debian GCC Maintainers 2003-07-06 12:54:32 UTC
Created attachment 4353 [details]
preprocessed source
Comment 2 Wolfgang Bangerth 2003-07-07 15:03:13 UTC
This is a known deficiency in the old parser that is already
fixed with the new parser to be part of gcc3.4. The work
around for now is to write
  p->template Release ();
Not nice, but works.

W.