[Issue 24025] Expressions contained in parentheses should not be assumed to be C casts
https://issues.dlang.org/show_bug.cgi?id=24025 Nick Treleaven changed: What|Removed |Added CC||ajiesk...@gmail.com --- Comment #4 from Nick Treleaven --- *** Issue 22217 has been marked as a duplicate of this issue. *** --
[Issue 24025] Expressions contained in parentheses should not be assumed to be C casts
https://issues.dlang.org/show_bug.cgi?id=24025 Dlang Bot changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #3 from Dlang Bot --- dlang/dmd pull request #15377 "Fix Issue 24025 - Expressions contained in parentheses should not be …" was merged into master: - 9f782c456e31a4fad5027961d64c346d388f1b7e by Nick Treleaven: Fix Issue 24025 - Expressions contained in parentheses should not be assumed to be C casts Allow `(identifier)` and `(BasicType)` when followed by a left parenthesis. These can be a function call or an implicit conversion - the latter may produce a semantic error (not a parse error). https://github.com/dlang/dmd/pull/15377 --
[Issue 24025] Expressions contained in parentheses should not be assumed to be C casts
https://issues.dlang.org/show_bug.cgi?id=24025 Dlang Bot changed: What|Removed |Added Keywords||pull --- Comment #2 from Dlang Bot --- @ntrel created dlang/dmd pull request #15377 "Fix Issue 24025 - Expressions contained in parentheses should not be …" fixing this issue: - Fix Issue 24025 - Expressions contained in parentheses should not be assumed to be C casts Allow `(identifier)` and `(BasicType)` when followed by a left parenthesis. These can be a function call or an implicit conversion - the latter may produce a semantic error (not a parse error). https://github.com/dlang/dmd/pull/15377 --
[Issue 24025] Expressions contained in parentheses should not be assumed to be C casts
https://issues.dlang.org/show_bug.cgi?id=24025 --- Comment #1 from Steven Schveighoffer --- An alternative to delaying the C style cast to semantic is to just remove the error. If a cast from C is desired, then it will work if the type can be constructed with that parameter. Back when this error was created, something like `int(5)` was not valid code. Now it is. So most cases of casting will just have a failed implicit cast error. Ironically, this error *hurts* porting C code, instead of helping. --