c++/9937: Failure to lookup base class name when base is template specialization
Wolfgang Bangerth
bangerth@ticam.utexas.edu
Tue Mar 4 16:22:00 GMT 2003
> | Something seems indeed inconsistent. Your access in struct Z
> | is bogus, but this is an extract:
>
> I don't think so.
>
> ~From ISO/IEC 14882
>
> 14.6/2a [...snip...]
Hmph, that's a section that's not in the draft that I use (I don't have a
copy of the final standard, unfortunately).
Given what you cite, that would be another but in gcc. At least, this
doesn't compile with gcc, but does with icc:
----------------------
template <typename> struct B {};
struct Z : B<int> { Z::B *b; };
----------------------
I must admit that I don't really understand the intention of the standard
authors, why this should find B<int>. I also don't understand why the
above should compile, but this variant of struct Z shouldn't (and doesn't
with either gcc and icc):
----------------------
template <typename> struct B {};
struct Z : B<int> { B *b; }; // use B, not Z::B
----------------------
In any case, all the problems in this report are easily worked around, so
while this seems like a bug I wouldn't want to have it high priority.
W.
-------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth@ticam.utexas.edu
www: http://www.ticam.utexas.edu/~bangerth/
More information about the Gcc-bugs
mailing list