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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/16102] New: Using references in trinary operator as un lvalue doesn't change the reference in some case


gcc version 3.4.0 (Red Hat Linux 3.4.0-1)
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-languages=c,c++,objc,java,f77
--host=i386-redhat-linux
Thread model: posix


The following code should change the value of rx:
  int x=5; int y=3;
  int& rx=x; int& ry=y;
  ((rx>ry) ? rx : ry) = 10;

However is doesn't.

The following code DO change the value of rx:
  int x=5; int y=3;
  int& rx=x; int& ry=y;
  ((rx>1) ? rx : ry) = 10;

The same happens for ry.

Compilation command didn't include any flags.

-- 
           Summary: Using references in trinary operator as un lvalue
                    doesn't change the reference in some case
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ofiravni99 at walla dot co dot il
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16102


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