Opened 8 years ago
Closed 9 months ago
#46 closed defect (fixed)
Enum constants are lvalues
| Reported by: | Rob Schluntz | Owned by: | Rob Schluntz |
|---|---|---|---|
| Priority: | minor | Component: | cfa-cc |
| Version: | 1.0 | Keywords: | |
| Cc: |
Description (last modified by )
Enum constants are currently lvalues, making for a cheap conversion to reference. Because of this, & operators are added incorrectly, causing gcc errors.
My first instinct was to say that all enum VariableExprs are non-lvalues, but of course this doesn't work since actual enum variables are lvalues. This will require a more nuanced approach, but I think the basic idea is right.
Example that causes an error:
enum E {
val
};
int main() {
E x[3];
3 ? x[2] : val;
}
Change History (2)
comment:1 by , 8 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 9 months ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
Fixed a little while ago by checking if the
VariableExpris wrapping a member or not.