Opened 4 years ago

Last modified 4 years ago

#141 new defect

conditional expression warning

Reported by: pabuhr Owned by:
Priority: minor Component: cfa-cc
Version: 1.0 Keywords:


int main() {
    char c[1] = { 3 };
    int r = 3 < 4 ? c[0] : 4;
CFA Version 1.0.0 (debug) warning: rvalue to reference conversion of rvalue: constant expression (4 4: signed int)

This warning seems wrong.

Change History (1)

comment:1 Changed 4 years ago by Rob Schluntz

Yeah, this definitely confirms my theory about #140; it's converting 4 to a reference here (so you'll get a temporary) rather than converting c[0] to int. You should be able to see that in the generated code for this one.

Note: See TracTickets for help on using tickets.