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

Thomas Witt witt@ive.uni-hannover.de
Tue Mar 4 16:16:00 GMT 2003


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

From: Thomas Witt <witt@ive.uni-hannover.de>
To: bangerth@dealii.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
   nobody@gcc.gnu.org, witt@ive.uni-hannover.de, gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: c++/9937: Failure to lookup base class name when base is template
 specialization
Date: Tue, 04 Mar 2003 17:10:16 +0100

 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
 bangerth@dealii.org wrote:
 | Synopsis: Failure to lookup base class name when base is template
 specialization
 |
 | State-Changed-From-To: open->analyzed
 | State-Changed-By: bangerth
 | State-Changed-When: Tue Mar  4 15:45:30 2003
 | State-Changed-Why:
 |     This applies to all versions of gcc since at least 2.95:
 |
 |     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
 
 "The injected-class-name of a class template or class template
 specialization can be used either with or without
 a template-argument-list wherever it is in scope. [Example:
 
 template <class T> struct Base {
 ~  Base* p;
 };
 
 template <class T> struct Derived: public Base<T> {
 ~  typename Derived::Base* p; // meaning Derived::Base<T>
 };
  end example ]"
 
 So if B<int> is in scope B is as well.
 
 |     I must admit that I don't know whether gcc is right or
 |     wrong here -- the treatment of NS::A and NS::B seems
 |     inconsistent --, but icc at least shares gcc's opinion:
 |     g/x> icc -c x.cc
 |     x.cc(9): error: B is not a template
 |       struct Y : NS::B<int> {  B<int>* b; };
 |                                ^
 
 Yep, I know this. And the Intel frontend developers are busy figuring
 whether they are wrong.
 
 FWIW intel win32 accepts the code. So does como on linux.
 
 Thanks
 
 Thomas
 
 - --
 Dipl.-Ing. Thomas Witt
 Institut fuer Verkehrswesen, Eisenbahnbau und -betrieb, Universitaet
 Hannover
 voice: +49(0) 511 762 - 4273, fax: +49(0) 511 762-3001
 http://www.ive.uni-hannover.de
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.1 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
 iD8DBQE+ZM/o0ds/gS3XsBoRAjYHAKCMrNAZkohsxZ0Gq4J1H3jQwwV28ACffmpE
 YbmrZX/Usvn6w0Cm/hgS31g=
 =83X2
 -----END PGP SIGNATURE-----
 



More information about the Gcc-prs mailing list