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]

egcs-2.91.43: fails on valid code (nested template)


Hello,

I believe the code below is legal. I might be wrong.

uname -a: SunOS zeal 5.5 Generic sun4u sparc SUNW,Ultra-1 

***** Program source:



template <typename T>
class A {
  template <typename U> class B;
};

template <typename T>
template <typename U>
class A<T>::B {
};


***** Compilation:


Reading specs from
/home/joseph/egcs/lib/gcc-lib/sparc-sun-solaris2.5/egcs-2.91.43/specs
gcc version egcs-gmake[1]: Leaving directory `/export/home/joseph/egbugs'
eph/egcs/lib/gcc-lib/sparc-sun-solaris2.5/egcs-2.91.43/cpp -lang-c++ -v -undef
-D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91 -Dsparc -Dsun -Dunix
-D__svr4__ -D__SVR4 -D__sparc__ -D__sun__ -D__unix__ -D__svr4__ -D__SVR4
-D__sparc -D__sun -D__unix -Asystem(unix) -Asystem(svr4) -D__EXCEPTIONS
-D__GCC_NEW_VARARGS__ -Acpu(sparc) -Amachine(sparc) b28.cc /var/tmp/cc0Foj2x
GNU CPP version egcs-2.91.43 19980628 (gcc2 ss-980502 experimental) (sparc)
#include "..." search starts here:
#include <...> search starts here:
 /home/joseph/egcs/include/g++
 /usr/local/include
 /home/joseph/egcs/sparc-sun-solaris2.5/include
 /home/joseph/egcs/lib/gcc-lib/sparc-sun-solaris2.5/egcs-2.91.43/include
 /usr/include
End of search list.
 /home/joseph/egcs/lib/gcc-lib/sparc-sun-solaris2.5/egcs-2.91.43/cc1plus
/var/tmp/cc0Foj2x -quiet -dumpbase b28.cc -version -o /var/tmp/cckBGprZ
GNU C++ version egcs-2.91.43 19980628 (gcc2 ss-980502 experimental)
(sparc-sun-solaris2.5) compiled by GNU C version egcs-2.90.27 980315 (egcs-1.0.2
release).
b28.cc:9: `A<T>' does not have a nested type named `template <class T> template
<class U> A<T>::B<U>'
b28.cc:9: template class without a name
gmake[1]: *** [b28] Error 1


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