Description of problem: Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Sorry, hit enter too soon. It seems that inside of a templated function call, a templated member function will make it think it's a syntax error. This work fine in RHEL4, but does not in RHEL3, with the newest gcc-c++ and libraries. Error: [root@linuxdevhq01 test]$ g++ test.cpp test.cpp: In function `void f()': test.cpp:13: syntax error before `>' token Code: #include <iostream> struct Object { template <typename T> T* g() { return NULL; } }; template <typename T> void f() { Object o; T* d = o.g<T>(); } int main() { f<int>(); return EXIT_SUCCESS; }
Please use T* d = o.template g<T>(); instead in RHEL3. While this is not mandatory in C++, this is one of the several problems that can't be fixed easily (and safely) in the old C++ parser. In G++ 3.4.0 the C++ parser has been rewritten and this rewrite made it far more ISO C++ compliant.