Opened 4 years ago

Closed 3 years ago

#74 closed defect (fixed)

Generic reference member generates incorrect code

Reported by: Rob Schluntz Owned by: Rob Schluntz <rschlunt@…>
Priority: major Component: cfa-cc
Version: 1.0 Keywords:


 forall( otype T )
 struct S { T i; };

 struct R {
     S(int) & s;

 cfa test.c
 CFA Version 1.0.0 (debug)
 test.c: In function '___operator_assign__F2sR_R2sR2sR_autogen___1':
 test.c:5:14: error: expected identifier or '(' before ')' token
      S(int) & s;
 test.c:5:13: error: '_temp1' undeclared (first use in this function)
      S(int) & s;
 test.c:5:13: note: each undeclared identifier is reported only once for each function it appears in

The problem is this line of generated code:

   struct S()  _temp1;

which is not C. This temporary is generated by the Box pass. May be related to #7.

Change History (1)

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

Owner: set to Rob Schluntz <rschlunt@…>
Resolution: fixed
Status: newclosed

In 1a4bef3:

Ensure that dereference type is marked as lvalue after reference conversion [fixes #74]

Note: See TracTickets for help on using tickets.