http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49327
Summary: Parse error involving "templated method inside
templated class"
Product: gcc
Version: 4.5.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: robi...@gmail.com
Compiler invocation: "g++ -ftemplate-depth-128 -O0 -fno-inline -Wall -g -c -o
buggy.o buggy.cpp"
Platform: both win32 and linux
I have attached (and pasted) reduced code that exhibit the behavior, with
explanation.
CODE:
template // REMOVE THIS LINE TO REMOVE PROBLEM
struct Delegate {
template
static void from_method(T *object_ptr) {}
};
template
struct Event {
typedef Delegate DelegateType; // REMOVE TO REMOVE PROBLEM
template
void connect_method(T *object_ptr) {
// The following line fails with:
// buggy.cpp:16:36: error: expected primary-expression before '>' token
DelegateType::from_method(object_ptr);
}
};
int main(int argc, char *argv[]) {
return 0;
}