This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Static data members in template declarations
According to Jason Merrill:
> >>>>> Alexandre Oliva <oliva@dcc.unicamp.br> writes:
>
> > Within the scope of S<T>, `a', `S::a' and `S<T>::a' are all the same
> > thing
>
> Nope. S::a and S<T>::a are the same, but they are dependent, and `a' is
> not. g++ doesn't currently implement that consistently.
Wouldn't you agree that it should?
As Stroustrup points out, generating warnings or errors for
*potential* inconsistencies is usually the wrong thing. Rather, only
when *actual* inconsistencies arise -- in this case, at instantiation
-- should the potential error be flagged as an actual error, or else
accepted if it's not wrong.
--
Chip Salzenberg - a.k.a. - <chip@perlsupport.com>
"There -- we made them swerve slightly!" //MST3K