Opened 8 years ago
Closed 8 years ago
#80 closed defect (fixed)
With statement and function parameters.
| Reported by: | Thierry Delisle | Owned by: | |
|---|---|---|---|
| Priority: | major | Component: | cfa-cc |
| Version: | 1.0 | Keywords: | with statment |
| Cc: |
Description
Users expect parameters to have priority over with statements, e.g.,
#include <fstream>
struct X {
int value;
};
void set(X & this, int value) with(this) {
this.value = value;
}
int main() {
X x;
set(x, 3);
sout | x.value | endl;
return 0;
}
I think the least surprising result would be that this prints 3, i.e., the parameter value has precedence over the field value.
Change History (1)
comment:1 by , 8 years ago
| Owner: | set to |
|---|---|
| Resolution: | → fixed |
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
In 6091435: