Opened 4 years ago

#177 new defect

typeof not being handled correctly by resolver

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


The following program compiles in C but fails to compile in Cforall. The resolver is not handling typeof correctly with respect to 0.

int main() {
    int i;
    int *ip = &i;
    typeof(*ip) x = 0;
CFA Version 1.0.0 (debug)
error: No reasonable alternatives for expression Untyped Init Expression
  constant expression (0 0: zero_t)  InitAlternative: reference to signed int

If the 0 is changed to 2 for the assignment, the error changes to

CFA Version 1.0.0 (debug) warning: rvalue to reference conversion of rvalue: constant expression (2 2: signed int)

Change History (0)

Note: See TracTickets for help on using tickets.