This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the EGCS project.
Re: '?:' bug in C++? (gcc version 2.95)
- To: Michael Rosenbruch <Rosenbruch@bfw-online.de>
- Subject: Re: '?:' bug in C++? (gcc version 2.95)
- From: Alexandre Oliva <oliva@dcc.unicamp.br>
- Date: 03 Aug 1999 10:34:48 -0300
- Cc: gcc-patches@gcc.gnu.org
- References: <Pine.LNX.4.05.9908030944540.20402-100000@lar.bfw.de>
On Aug 3, 1999, Michael Rosenbruch <Rosenbruch@bfw-online.de> wrote:
> In that case the previous mail was a bug report, because in given example
> the operator ?: do definedly wrong.
> (I didn't realize if you notice that).
I didn't, thanks for your persistence :-)
Here's a simplified version of your testcase, that I'm installing in
the testsuite:
// Copyright (C) 1999 Free Software Foundation
// by Alexandre Oliva <oliva@dcc.unicamp.br>
// simplified from bug report by Michael Rosenbruch <Rosenbruch@bfw-online.de>
// Special g++ Options:
// execution test - XFAIL *-*-*
extern "C" void abort();
int main () {
char x[1];
char *y = x ? /* implicit x */ : 0;
/* For some reason, the array x is copied twice, and y points to the
second copy (the first is never used). If x is explicit, no copy
is created, and the program succeeds. */
if (x != y)
abort();
}
--
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
oliva@{dcc.unicamp.br,guarana.{org,com}} aoliva@{acm.org,computer.org}
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
** I may forward mail about projects to mailing lists; please use them