This is the mail archive of the mailing list for the libstdc++ project. See the libstdc++ home page for more information.

[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

Re: Static data members in template declarations

> I'm interested in other people's opinions of my interpretation of the
> standard here.

I think the construct you present is legal C++. Your observation is
correct: that the declaration of t uses a non-dependent array size,
and the definition uses a dependent array size. This does not make the
template definition ill-formed.

In the definition, the name is dependent, and thus not bound at
template definition time. Instead, the compiler should check at
instantiation time whether declaration and definition match. As far as
I can tell, it is not possible to instantiate the template so that the
instantiation is in error. In any case, the diagnostics should be
produced at the point of instantiation.

Just my 0.02EUR,