g++ 2.96 new ICE with templates.
Alfred Minarik
a8601248@unet.univie.ac.at
Tue Aug 31 22:45:00 GMT 1999
Mark Mitchell wrote:
>
> By the way, this code isn't legal ANSI/ISO C++. Why not say
> `const int __size = 5', which would make it legal?
Yes I know this, and personally wouldn't write it,
but as stated it is from libstdc++v3. The original places are
in libstdc++/bits/fstream.tcc and in one case it goes
...
int __plen = _M_out_cur - _M_out_beg;
if (!__testeof)
__plen += sizeof(char_type);
char_type __pbuf[__plen];
...
[I was by myself a bit surprised about that, as
one goal of a standard c++ library should be to
implement as much as possible in standard c++
quite from the beginning;
something for libstdc++ mailinglist...]
The submitted code is the result of a
cut-compile-cut-compile-undo-cut-compile...
session to shrink into a small testcase.
By testing with fixed sized arrays,
soon other ICEs come up...
the next in an try-catch block without
arrays at all.
Maybe I should have taken that, but
an ICE is an ICE and I didn't want to do
those shrinking again, but sending in
the first one and react depending on the
reply.
As I have already suspected something like
your other reply:
>Basically, I expect to be breaking g++ rather badly over the next few
>weeks. I'll also be picking up all the pieces, and we'll be better
>off when I'm done. But, it would be an even worse idea than usual to
>rely on snapshots for serious work for a bit.
I therefor hesitated to send in the first
bugreport. But then I saw the new
testsuite/g++.old-deja/g++.pt/crash49.C,
which seemed to have some similarities and
to be introduced at the same time, but already
resolved. And which parallels a first ICE
I got out of libstdc++v3 and is now ok.
This gave me the impression that this
might really be a leftover.
It's probably better to
have one report too much,
than one too less.
Now its time to check again in some weeks.
It seems the libstdc++v3 makes
nice additional tests for g++.
Alfred
More information about the Gcc-bugs
mailing list