This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c++/3793: template class rejected as template arg to a template member



>Number:         3793
>Category:       c++
>Synopsis:       template class rejected as template arg to a template member
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 24 09:46:02 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Stefan Schwarzer
>Release:        gcc-3.0
>Organization:
>Environment:
alpha osf5.0, x86-linux
>Description:
The following segment attempts to invoke a template member
of a base class with an explicit template 
argument. g++-3.0 produces a syntax error (which btw. is 
slightly different, if the body of the function 'worker' 
is defined outside class B). IMHO and that of edg frontends,
the code is legal.

18:35 margay_sts:~/bugs/gnu> uname -a 
OSF1 margay.ica1.uni-stuttgart.de V5.0 910 alpha
18:35 margay_sts:~/bugs/gnu> g++ -v
Reading specs from /local/gcc-3.0/lib/gcc-lib/alphaev56-dec-osf4.0f/3.0/specs
Configured with: /share/src/gcc-3.0/configure --prefix=/local/gcc-3.0 --host=alphaev56-dec-osf4.0f --target=alphaev56-dec-osf4.0f
Thread model: single
gcc version 3.0
18:35 margay_sts:~/bugs/gnu> g++ tt.cc
tt.cc: In member function `virtual double B<T>::worker()':
tt.cc:16: parse error before `;' token
18:35 margay_sts:~/bugs/gnu> cat tt.cc

template<class T>
struct A{

  template<class U>
  double helper(){ return 42.; }

}; 


template<class T>
struct B : A<T> {

  virtual double worker()
  {
    return A<T>::helper< B >();
  }

};


int main(){
  B<double>  b;
  b.worker();
}
>How-To-Repeat:
try to  compile the code given in the project description
on Linux or Alpha platforms
>Fix:
I wish I knew...
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]