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

--- Comment #10 from Jonathan Wakely <redi at gcc dot gnu.org> 2010-10-11 
14:14:39 UTC ---
(In reply to comment #8)
> Ok. If I understand the standard correct is the template keyword on the
> following places 
> 
> const int A<a>::template B<b>::value = A<a>::template B<b>::C::value;
> 
> correct but optional, right? The online Comeau accepts this without errors,
> however, gcc gives me an error on the first template keyword.

That might be a bug too, I think both occurrences of 'template' are valid.

Reduced form, Jason, are the "should be" comments below correct?

template<int a>
struct A {
    static const int value;
    template<int b>
    struct B {
        static const int value;
    };

};

// should be rejected, value is not a template
template<int a>
const int A<a>::template value = 0;

// should be accepted, B<b> is a template
template<int a>
template<int b>
const int A<a>::template B<b>::value = 0;

Reply via email to