c++/1058: gcc version 2.95.2 produces "parse error before `>'"

haule@tkm.physik.uni-karlsruhe.de haule@tkm.physik.uni-karlsruhe.de
Wed Dec 13 15:56:00 GMT 2000


>Number:         1058
>Category:       c++
>Synopsis:       gcc version 2.95.2 produces "parse error before `>'"
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 13 15:56:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Kristjan Haule
>Release:        Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs gcc version 2.95.2 20000220 (Debian GNU/Linux)
>Organization:
>Environment:
2*Pent 500 256MB
>Description:
The simple code is legal (I think), but produces the following error message:
poskus.cc: In method `void C<T>::just_function()':
poskus.cc:25: parse error before `>'
>How-To-Repeat:
#include <iostream>

class B{
  typedef int    type1;
  typedef double type2;
};

class A{
public:
  template <class X>
  void Set(typename X::type1 t1, typename X::type2 t2) {};
};

template <class T>
class C{
public:
  void just_function();
};

template <class T>
void C<T>::just_function()
{
  A a;
  B b;
  a.Set<B>(3, 2.2);
}

int main()
{
  C<int> c;
  return 0;
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++src; name="poskus.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="poskus.cc"

I2luY2x1ZGUgPGlvc3RyZWFtPgoKY2xhc3MgQnsKICB0eXBlZGVmIGludCAgICB0eXBlMTsKICB0
eXBlZGVmIGRvdWJsZSB0eXBlMjsKfTsKCmNsYXNzIEF7CnB1YmxpYzoKICB0ZW1wbGF0ZSA8Y2xh
c3MgWD4KICB2b2lkIFNldCh0eXBlbmFtZSBYOjp0eXBlMSB0MSwgdHlwZW5hbWUgWDo6dHlwZTIg
dDIpIHt9Owp9OwoKdGVtcGxhdGUgPGNsYXNzIFQ+CmNsYXNzIEN7CnB1YmxpYzoKICB2b2lkIGp1
c3RfZnVuY3Rpb24oKTsKfTsKCnRlbXBsYXRlIDxjbGFzcyBUPgp2b2lkIEM8VD46Omp1c3RfZnVu
Y3Rpb24oKQp7CiAgQSBhOwogIEIgYjsKICBhLlNldDxCPigzLCAyLjIpOwp9CgppbnQgbWFpbigp
CnsKICBDPGludD4gYzsKICByZXR1cm4gMDsKfQo=


More information about the Gcc-prs mailing list