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++/51317] New: Wrong value category of conditional expression where lvalue operands differ only in cv-qualification (see DR 587)


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

             Bug #: 51317
           Summary: Wrong value category of conditional expression where
                    lvalue operands differ only in cv-qualification (see
                    DR 587)
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tsoae@mail.ru


GCC 4.7.0 rejects the following application of address-of operator:

    int x = 1;
    int const y = 2;
    int const *p = &(1 ? x : y); // error: lvalue required as unary '&' operand

Such behavior was correct in C++03, but it is incorrect in C++11 - see
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#587


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