This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: compiler error
- To: Trevor Spiteri <tbspit at cce dot eng dot um dot edu dot mt>
- Subject: Re: compiler error
- From: Nathan Sidwell <nathan at acm dot org>
- Date: Wed, 03 Nov 1999 09:41:13 +0000
- CC: egcs-bugs at egcs dot cygnus dot com
- References: <199911030841.JAA20535@cce.eng.um.edu.mt>
- Reply-To: nathan at compsci dot bristol dot ac dot uk
Trevor Spiteri wrote:
>
> The source file err.cc follows:
>
> template <class T>
> class c {
> public:
> int p;
> void f()
> {
> c<int> r;
> r.p = (typeof(r.p))3;
> }
> };
GNU C version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release).
> err.cc: In method `void c<T>::f()':
> err.cc:8: Internal compiler error.
> err.cc:8: Please submit a full bug report to `egcs-bugs@egcs.cygnus.com'.
> err.cc:8: See <URL:http://egcs.cygnus.com/faq.html#bugreport> for details.
2.95 says,
nathan@manao:610>g++ -c -W -Wall spiteri.C
spiteri.C: In method `void c<T>::f()':
spiteri.C:8: parse error before `3'
when one uses `__typeof__', it compiles without error.
The non-template equivalent gives a more informative diagnostic,
nathan@manao:612>g++ -c -W -Wall spiteri.C
spiteri.C: In method `void c::f()':
spiteri.C:8: implicit declaration of function `int typeof(...)'
spiteri.C:8: parse error before `3'
nathan
--
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
I have seen the death of PhotoShop -- it is called GIMP
nathan@acm.org http://www.cs.bris.ac.uk/~nathan/ nathan@cs.bris.ac.uk