-
-
Notifications
You must be signed in to change notification settings - Fork 609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dtoh: Properly handle default values of function arguments #11866
Conversation
|
Thanks for your pull request and interest in making D better, @MoonlightSentinel! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#11866" |
18b8c1d to
6eff67b
Compare
| m = 1LL, | ||
| }; | ||
|
|
||
| extern void enums(uint64_t e = $?:32=1LLU|64=E::m$); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THis is necessary because the frontend generates different AST's for -m32 (IntegerExp) and -m64 (DotIdExp) ...
| @@ -1703,7 +1703,7 @@ struct ParameterList | |||
| Array<Parameter*>* parameters; | |||
| StorageClass stc; | |||
| VarArg varargs; | |||
| ParameterList(Array<Parameter*>* parameters, VarArg varargs = cast(VarArg)cast(ubyte)0u, StorageClass stc = 0); | |||
| ParameterList(Array<Parameter*>* parameters, VarArg varargs = (VarArg)0u, StorageClass stc = 0); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this still a cast, but STC is displayed correctly ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StorageClass is a typedef, not an enum.
| @@ -750,7 +750,7 @@ struct Loc | |||
| const char* filename; | |||
| uint32_t linnum; | |||
| uint32_t charnum; | |||
| const char* toChars(bool showColumns, uint8_t messageStyle) const; | |||
| const char* toChars(bool showColumns = global.params.showColumns, uint8_t messageStyle = global.params.messageStyle) const; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will trigger a forward reference error, since global (the variable) is declared at L7118
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, the added code will now properly emit forward references (but there are some more issues in the existing code which i would rather defer into another PR)
|
That would also fix https://issues.dlang.org/show_bug.cgi?id=21304 right ? |
6eff67b to
4703b21
Compare
Yes |
Removes the special casing in favour of visiting the actual expression and implements handlers for expressions which require different syntax in C++ (e.g. static member access, implicit dereferencing of pointers, ...).
4703b21 to
7b134cd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noice
Removes the special casing in favour of visiting the actual expression and implements handlers for expressions which require different syntax in C++ (e.g. static member access, implicit dereferencing of pointers, ...).
CC @Geod24