g++ 2.95 Sun,HP: problem with forward-declared nested derived class , template
Matt Messina
messina@umich.edu
Thu Nov 11 00:48:00 GMT 1999
Two instances of the same problem: one on Solaris 2.6, one on HP-UX 10.20;
both with gcc 2.95.1.
If the nested class (B) is fully declared (rather than just forward
declared) inside the "outer" class (A), it compiles correctly.
BTW, this code compiles correctly (without making that change) with egcs
2.91.66 on Solaris 2.7.
--
Matt Messina
messina@umich.edu
------------------------------
% uname -a
HP-UX maize B.10.20 A 9000/782 2016022320 two-user license
% g++ -v
Reading specs from /afs/.engin.umich.edu/um/hp7_1020/gnu/gcc-2.95.1/lib/gcc-lib/hppa2.0-hp-hpux10.20/2.95.1/specs
gcc version 2.95.1 19990816 (release)
% cat -n a.cc
1 // problem with forward-declared nested derived class template
2
3 template <typename T>
4 class A
5 {
6 public:
7 class B;
8 };
9
10 template <typename T>
11 class A<T>::B : public T
12 {
13 };
% g++ -c a.cc
a.cc:12: Internal compiler error.
a.cc:12: Please submit a full bug report.
a.cc:12: See <URL: http://www.gnu.org/software/gcc/faq.html#bugreport > for instructions.
------------------------------
% uname -a
SunOS blue.engin.umich.edu 5.6 Generic_105181-13 sun4u sparc SUNW,Ultra-2
% g++ -v
Reading specs from /afs/.engin.umich.edu/um/sun_56/gnu/gcc-2.95.1/lib/gcc-lib/sparc-sun-solaris2.6/2.95.1/specs
gcc version 2.95.1 19990816 (release)
% cat -n a.cc
1 // problem with forward-declared nested derived class template
2
3 template <typename T>
4 class A
5 {
6 public:
7 class B;
8 };
9
10 template <typename T>
11 class A<T>::B : public T
12 {
13 };
% g++ -c a.cc
a.cc:12: Internal compiler error.
a.cc:12: Please submit a full bug report.
a.cc:12: See <URL: http://www.gnu.org/software/gcc/faq.html#bugreport > for instructions.
More information about the Gcc-bugs
mailing list