[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#198042: template keyword workaround for broken parser (undef function) doesn't work



On Wednesday 09 July 2003 07:20 pm, Daniel Stone wrote:
> Hi guys,
> When I try the "p->template Release ();" workaround suggested in
> http://bugs.debian.org/198042 (from http://bugs.gcc.org/PR11444), I get
> ../include/ccom.h: In destructor `CPtr<T>::~CPtr()':
> ../include/ccom.h:74: error: syntax error before `;' token

That's true here, but it's because your code is invalid :-) What happens is 
that you use CPtr<CWord1> before CWord1 is declared (except for a forward 
declaration). You see that if you try to change (for test purposes) 
CPtr<T>::~CPtr() to
        ~CPtr()
        {
                if (p)
                {
	  	  T t;
	          p->Release();
                }
        }
Then you'll get 
qparser.ii:18929: error: `t' has incomplete type
qparser.ii:18929: error: storage size of `t' isn't known
qparser.ii:18930: error: `Release' undeclared (first use this function)

(and a host of other errors later on, but this one is for T=CWord1). So change 
the order of declarations of your classes (and the use of CPtr<CWord1>) and 
it should work just fine.

W.

-------------------------------------------------------------------------
Wolfgang Bangerth              email:            bangerth@ices.utexas.edu
                               www: http://www.ices.utexas.edu/~bangerth/




Reply to: