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]

Template bug in gcc-2.95-2 on i386-redhat-linux


Hi. The following code is mysteriously rejected on my gcc-2.95-2
i386-redhat-linux.
I would be grateful for any hints to get around it, I have tried using
parentheses around
the foo.Bar<float>(3) function call but without success. The ultimate
help would be
a bug fix of course ...

Regards
/Oskar Enoksson

//////// foo.cpp ///////////
class Foo {
public:
  template<class T> void Bar(int i);
};

template<class T>
void test(Foo &foo) {
  foo.Bar<float>(3);
}

int main() {
  Foo foo;
  test<float>(foo);
}
/////////////////

>  c++ -c --ansi --pedantic -Wall foo.cpp
foo.cpp: In function `void test(Foo &)':
foo.cpp:8: parse error before `>'
>



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