Commit graph

2 commits

Author SHA1 Message Date
Iain Buclaw
6fee5868f2 dtoh: Always refer to default arguments using their FQN.
Static variables used in a default argument context are now emitted using
their fully qualified name. This is to avoid generating ambiguous
assignments, for instance:
```
struct S
{
    __gshared int param;
    void example(int param = S.param);
}
```
In the above example, the visitor for dtoh VarExp will omit the `S`
parent, as the static field is nested in `S`.
```
    void example(int param = param);
```
Although D understands that `param` refers to the static field, this is
not the case in C++, and the compilation will fail with:
```
error: parameter 'param' may not appear in this context
```
2023-08-04 07:51:19 +08:00
Iain Buclaw
6374bb87b7 Move dmd files into compiler/ 2022-07-09 18:53:07 +02:00
Renamed from test/compilable/dtoh_StructDeclaration.d (Browse further)