http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52350

             Bug #: 52350
           Summary: Parse error calling a template method in a template
                    class
    Classification: Unclassified
           Product: gcc
           Version: 4.5.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: jos...@mirriad.com


The following code is self explanatory. Fails to compile as is, but succeeds if
you replace #if 1 with #if 0.


template<typename FP>
class Factory
{
public:
    template<typename T>
    T constructT() { return T(); }
};

template<typename T, typename FP>
class FactoryClient
{
public:
    T construct() {
#if 1
        Factory<FP> factory; // fails
#else
        Factory<int> factory; // works
#endif
        return factory.constructT<T>();
    }
};

int main()
{
}

Reply via email to