egcs-970910 unable to handle scoped typedef

Gabriel Dos Reis Gabriel.Dos-Reis@dptmaths.ens-cachan.fr
Sat Sep 13 06:26:00 GMT 1997


egcs-970910 gets confused by this code:

% cat toto.C
template <class T> struct foo {
    typedef T fred_t;

    struct bar {
        bar(fred_t );
    };
};

template <class T>
foo<T>::bar::bar(foo<T>::fred_t f) {}


% g++ -c toto.C
toto.C:10: prototype for `foo<T>::bar::bar(typename foo<T>::fred_t)' does not match any in class `foo<T>::bar'
toto.C:5: candidate is: foo<T>::bar::bar(T)
toto.C: In method `foo<T>::bar::bar(typename foo<T>::fred_t)':
toto.C:10: template definition of non-template `foo<T>::bar::bar(typename foo<T>::fred_t)'
    

Things go ok if one replaces foo<T>::fred_T by T.

-- Gaby



More information about the Gcc mailing list