This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the EGCS project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: '?:' bug in C++? (gcc version 2.95)


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]