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<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;
}

Reply via email to