------- Additional Comments From jaco at kroon dot co dot za  2005-02-26 10:03 
-------
A more complex example, this code works with gcc 3.3 so this imho is either
incorrect code or a bug in the new parses:

template <class T> class FakeList {
public:
        void foo() {};
};

template <class T> class Factory {
public:
        typedef T* (*CreateType)();
        typedef struct { char *name; CreateType creator; } TypePair;
        static FakeList<TypePair> _types;

        T* createOne() {
                _types.foo();
                return 0;
        };
};

typedef Factory<int> IntFactory;

/*
 * I've tried prefixing this with template <>
 * which them compiles, but fails to link.
 */
FakeList<IntFactory::TypePair> IntFactory::_types;

int main(int, char**) {
        IntFactory blah;
        blah.createOne();

        return 0;
}

I'm using gcc 3.4.3 on amd64.

-- 


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

Reply via email to