Opened 7 years ago

Closed 7 years ago

#39 closed defect (fixed)

Global const array initialization broke with references

Reported by: Rob Schluntz Owned by: Rob Schluntz
Priority: critical Component: cfa-cc
Version: 1.0 Keywords: global const array initialization references
Cc:

Description

const int fred[1] = { -2 }; // fails for const and negative value

test.c:8 error: No reasonable alternatives for expression Cast of:
  Applying untyped: 
    Name: ?[?]
  ...to: 
    Variable Expression: fred: array of const signed int with dimension of Cast of:
          constant expression (1 1: one_t)
        to:
          long unsigned int
        with environment:
          Types:
          Non-types:


    Variable Expression: _index0: signed int


to:
  reference to signed int

error: No reasonable alternatives for expression Cast of:
  Applying untyped: 
    Name: ?[?]
  ...to: 
    Variable Expression: fred: array of const signed int with dimension of Cast of:
          constant expression (1 1: one_t)
        to:
          long unsigned int
        with environment:
          Types:
          Non-types:


    Variable Expression: _index0: signed int


to:
  reference to signed int

Change History (1)

comment:1 Changed 7 years ago by Rob Schluntz <rschlunt@…>

Resolution: fixed
Status: assignedclosed

In 0c6596f:

Handle difference between reference casting and implicit conversion costs [fixes #39]

Note: See TracTickets for help on using tickets.