This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49327] New: Parse error involving "templated method inside templated class"
- From: "robinei at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 8 Jun 2011 17:20:12 +0000
- Subject: [Bug c++/49327] New: Parse error involving "templated method inside templated class"
- Auto-submitted: auto-generated
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: unassigned@gcc.gnu.org
ReportedBy: robinei@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<typename Arg1> // REMOVE THIS LINE TO REMOVE PROBLEM
struct Delegate {
template <class T>
static void from_method(T *object_ptr) {}
};
template<typename Arg1>
struct Event {
typedef Delegate<Arg1> DelegateType; // REMOVE <Arg1> TO REMOVE PROBLEM
template <class T>
void connect_method(T *object_ptr) {
// The following line fails with:
// buggy.cpp:16:36: error: expected primary-expression before '>' token
DelegateType::from_method<T>(object_ptr);
}
};
int main(int argc, char *argv[]) {
return 0;
}