public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* Re: Funky templates in namespaces crash g++
  1999-04-30 23:15 Funky templates in namespaces crash g++ Lauri Alanko
@ 1999-04-16 16:33 ` Martin v. Loewis
  0 siblings, 0 replies; 2+ messages in thread
From: Martin v. Loewis @ 1999-04-16 16:33 UTC (permalink / raw)
  To: la; +Cc: egcs-bugs

> I hope this information is sufficient. Please try to get this fixed.

It is :-) I compiled this with egcs-2.93.17, and it compiles without
problems. Feel free to use a snapshot now, or wait for egcs 1.2 later
this year.

Regards,
Martin
>From lucask@interlog.com Fri Apr 16 16:51:00 1999
From: Lucas Korytkowski <lucask@interlog.com>
To: egcs-bugs@egcs.cygnus.com
Subject: Compilation problems egcs-1.1.2 & libc6
Date: Fri, 16 Apr 1999 16:51:00 -0000
Message-id: <4.1.19990416195651.009975e0@mail.interlog.com>
X-SW-Source: 1999-04/msg00468.html
Content-length: 1750

I did some searching in the archives and found out that way back in January
and it was found that there was a problem with the configure script with
libc6.  I've read on and there was a patch to fix egcs 1.0.x.  I have the
same problem with egcs-1.1.2 (1990405 and 1990412).  Am I doing something
wrong?

Does anyone else have these problems?  I'm running a system with Redhat 5.2
and one with Suse 6.0.  Here is my config script followed by the error codes:


/usr/local/source/egcs-19990405/configure --target=m68k-elf
--prefix=/usr/local/gcc-m68k --with-headers=/usr/include
--with-libraries=/usr/local/gcc-m68k/lib 

Here is the error that I am getting when issuing a 'make cross':

  /usr/local/build/egcs/gcc/xgcc -B/usr/local/build/egcs/gcc/
-B/usr/local/gcc-m68k/m68k-elf/bin/ -c -g -O2 -I.
-I/usr/local/source/egcs-19990405/libio
/usr/local/source/egcs-19990405/libio/filedoalloc.c -o pic/filedoalloc.o
/usr/local/build/egcs/gcc/xgcc -B/usr/local/build/egcs/gcc/
-B/usr/local/gcc-m68k/m68k-elf/bin/ -c -g -O2 -I.
-I/usr/local/source/egcs-19990405/libio
/usr/local/source/egcs-19990405/libio/filedoalloc.c
In file included from /usr/local/source/egcs-19990405/libio/libio.h:30,
                 from /usr/local/source/egcs-19990405/libio/iolibio.h:1,
                 from /usr/local/source/egcs-19990405/libio/libioP.h:40,
                 from /usr/local/source/egcs-19990405/libio/filedoalloc.c:48:
_G_config.h:43: parse error before `_G_sigset_t'
_G_config.h:43: warning: data definition has no type or storage class
make[2]: *** [filedoalloc.o] Error 1
make[2]: Leaving directory `/usr/local/build/egcs/m68k-elf/libio'
make[1]: *** [all-target-libio] Error 2
make[1]: Leaving directory `/usr/local/build/egcs'
make: *** [cross] Error 2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Funky templates in namespaces crash g++
@ 1999-04-30 23:15 Lauri Alanko
  1999-04-16 16:33 ` Martin v. Loewis
  0 siblings, 1 reply; 2+ messages in thread
From: Lauri Alanko @ 1999-04-30 23:15 UTC (permalink / raw)
  To: egcs-bugs

Hello, there.

Problem: Trying to compile this code with NAMESPACE defined causes an
internal compiler error. When the template is outside namespaces, it
works all right.

Full error message:
g++ -DNAMESPACE -Wall -W -Winline -ansi -pedantic -save-temps -c t.C -o t.o
t.C: In instantiation of `Check<X,int>':
t.C:25:   instantiated from `::N::::N::Check<X,int>'
t.C:25:   instantiated from here
t.C:25: Internal compiler error.
t.C:25: Please submit a full bug report to `egcs-bugs@egcs.cygnus.com'.
t.C:25: See <URL: http://egcs.cygnus.com/faq.html#bugreport > for details.

The code in question (a pretty minimal example):
#ifdef NAMESPACE
namespace N {
#endif
template <class Base, class Derived>
class Check {
	struct Big {
		int x[2]; 
		static Big f(void *)
			{return Big ();}
		static char f (Base*)
			{return 1;}
	};
public:
	enum{isA = (sizeof(Big::f(static_cast<Derived*>(0))) == 1)};
};
#ifdef NAMESPACE
}
using namespace N;
#endif

class X;

template <class T, bool N = Check<X, T>::isA> class RP;

RP<int> * q;

Compiler version:
$ g++ -v    
Reading specs from /usr/lib/gcc-lib/i486-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 Debian GNU/Linux (egcs-1.1.2 release)

System: Linux/i386 2.2.5-ac4, glibc 2.1.1

WTF is that template supposed to do: See
http://lazy.ton.tut.fi/~esap/instructive/simulating-constrained-genericity.html


I hope this information is sufficient. Please try to get this fixed.

Thanks,


Lauri Alanko
la@iki.fi


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-04-30 23:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-04-30 23:15 Funky templates in namespaces crash g++ Lauri Alanko
1999-04-16 16:33 ` Martin v. Loewis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).