This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/9937: Failure to lookup base class name when base is templatespecialization


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

bangerth at dealii dot 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-----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]