infinite recursion in parser, 1.1.1 prerelease

Andris Pavenis
Wed Nov 4 00:38:00 GMT 1998

This small program brings the parser in an endless recursion loop:
> template <class T>
> struct A {
>    typedef int TYPE;
> };
> template <class T>
> struct B : public A<T> {
>    struct C {
>       TYPE i;
>    };
> };
> The parser crashes at the second occurence of `TYPE', in the nested structure
> C. This phenomenon has been already observed with the egcs release 1.1, but I
> haven't managed to reduce the test suite to a reasonable size that time. Now
> it's small enough, isn't it?
> The prerelease was tested under Solaris 2.6 on the SPARC platform:
> SunOS goldfinger 5.6 Generic_105181-04 sun4u sparc SUNW,Ultra-1
> and configured with following options:
> --host=sparc-sun-solaris2.6 --prefix=/usr/local/egcs --enable-shared
> --enable-version-specific-runtime-libs
> I hope, this bug is severe enough to be fixed already in the upcoming 1.1.1
> release.

I don't see this problem with DJGPP ports of
egcs-2.91.57 and 2.91.58. gcc only founds errors
in that code.


Reading specs from c:/djgpp/lib/gcc-lib/djgpp/egcs-291.58/specs
gcc version egcs-2.91.58 19981101 (egcs-1.1.1 pre-release)
 c:/djgpp/lib/gcc-lib/djgpp/egcs-291.58/cpp.exe -lang-c++ -v -isystem c:/djgpp/bin/include -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91 -Dunix -Di386 -DGO32 -DMSDOS -DDJGPP=2 -D__unix__ -D__i386__ -D__GO32__ -D__MSDOS__ -D__DJGPP__=2 -D__unix -D__i386 -D__GO32 -D__MSDOS -D__DJGPP=2 -Asystem(unix) -Asystem(msdos) -Acpu(i386) -Amachine(i386) -D__EXCEPTIONS -D__OPTIMIZE__ E:/cclmLcXK.ii
GNU CPP version egcs-2.91.58 19981101 (egcs-1.1.1 pre-release) (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:
End of search list.
 c:/djgpp/lib/gcc-lib/djgpp/egcs-291.58/cc1plus.exe E:/cclmLcXK.ii -quiet -dumpbase -O3 -version -o E:/cc0T9iOC.s
GNU C++ version egcs-2.91.58 19981101 (egcs-1.1.1 pre-release) (djgpp) compiled by GNU C version egcs-2.91.58 19981101 (egcs-1.1.1 pre-release). explicit instantiation of non-template type `A' explicit instantiation of non-template type `B'

See the original message at
Free e-mail group hosting at

More information about the Gcc-bugs mailing list