Skip to content

Comma operator in C semantics #582

@h0nzZik

Description

@h0nzZik

This fails to compile:

int x = (2,3);

The top of the K cell:

toRVal(tv(#token("3","Int"),ut(`SetItem`(`IntegerConstant_C-TYPING-SYNTAX`(.KList)),`int_C-TYPING-SYNTAX`(.KList))))~>
compoundExp(toRVal(checkUse(tv(#token("3","Int"),ut(`SetItem`(`IntegerConstant_C-TYPING-SYNTAX`(.KList)),`int_C-TYPING-SYNTAX`(.KList))))))~>
`reval()_C-COMMON-EXPR-EVAL`(.KList)~>
`#freezerInitializer(_:=_)_C-SYNTAX0_`(nclv(loc(obj(#token("2","Int"),#token("4","Int"),static(#token("\"empty0.ce8e2d306-e039-11e9-94df-f2515646699c\"","String"))),#token("0","Int")),t(quals(`.Set`(.KList)),`.Set`(.KList),`int_C-TYPING-SYNTAX`(.KList))))~>

However, if x is a local variable, everything works:

int main(){int x = (2,3);}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions