https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63438

            Bug ID: 63438
           Summary: conditional operator deducing lvalues incorrectly
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eric.niebler at gmail dot com
            Target: i686-pc-cygwin

Problem is with the following code:

    int i = 0;
    const int j = 0;
    static_assert(std::is_same<decltype(true? i : j), int const &>::value, "");

I expect the static_assert to pass. It doesn't. It does with clang. Compiled
with -std=gnu++11.

$ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/local/gcc-4.9.0/bin/gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc-4.9.0/libexec/gcc/i686-pc-cygwin/4.9.0/lto-wrapper.exe
Target: i686-pc-cygwin
Configured with: ../gcc-4.9.0/configure --prefix=/usr/local/gcc-4.9.0
--disable-bootstrap --enable-languages=c,c++
Thread model: single
gcc version 4.9.0 (GCC)

Reply via email to