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

            Bug ID: 66211
           Summary: Rvalue conversion in ternary operator causes internal
                    compiler error
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vgheorgh at gmail dot com
  Target Milestone: ---

The code below

void f(int&){}

int main()
{
    int x = 0;
    double y = 1;
    f(1 > 0 ? x : y);
}

should not compile, due to rvalue conversion in the ternary operator, then
trying to bind the rvalue to a non-constant reference. However, gcc51 and gcc6
HEAD crash with an internal compiler error

     internal compiler error: in convert_like_real, at cp/call.c:6471

gcc49 works (emits an error)

Reply via email to