c++/10141: Member template parsing problem
rodrigo@esss.com.br
rodrigo@esss.com.br
Tue Mar 18 23:26:00 GMT 2003
>Number: 10141
>Category: c++
>Synopsis: Member template parsing problem
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Tue Mar 18 21:06:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Rodrigo Lucianetti
>Release: 3.2.2
>Organization:
>Environment:
linux redhat 8.0,dual AMD athlon MP 1800
>Description:
bug.cpp: In member function `unsigned int Foo2<T1>::Bar(Foo<C1>)':
bug.cpp:18: parse error before `;' token
>How-To-Repeat:
c++ -c -o bug.o bug.cpp
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="bug.cpp"
Content-Disposition: inline; filename="bug.cpp"
template<class C>
class Foo {
public:
template<class T>
unsigned Bar()
{
return 0;
}
};
template<class T1>
class Foo2 {
public:
template<class C1>
unsigned Bar( Foo<C1> foo )
{
return foo.NumOf<T1>();
}
};
int main()
{
Foo<int> foo;
foo.Bar<int>();
Foo2<int> foo2;
foo2.Bar( foo );
return 0;
}
More information about the Gcc-bugs
mailing list