c++/9937: Failure to lookup base class name when base is template specialization

Wolfgang Bangerth bangerth@ticam.utexas.edu
Tue Mar 4 16:26:00 GMT 2003


The following reply was made to PR c++/9937; it has been noted by GNATS.

From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: Thomas Witt <witt@ive.uni-hannover.de>
Cc: gcc-bugs@gcc.gnu.org, <gcc-gnats@gcc.gnu.org>
Subject: Re: c++/9937: Failure to lookup base class name when base is template
 specialization
Date: Tue, 4 Mar 2003 10:22:38 -0600 (CST)

 > |     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-prs mailing list