Bug 22529 – wrong deprecation about empty statement
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-11-20T09:38:31Z
Last change time
2021-12-14T10:34:27Z
Keywords
diagnostic, pull
Assigned to
No Owner
Creator
Basile-z
Comments
Comment #0 by b2.temp — 2021-11-20T09:38:31Z
Code:
====
---
void main() {
f()
return;
}
---
Output:
======
> /tmp/temp_7FCF86B2C530.d:4:3: Error: found `return` when expecting `;` following statement
> /tmp/temp_7FCF86B2C530.d:4:9: Deprecation: use `{ }` for an empty statement, not `;`
Problem:
=======
The error message is right, the deprecation message is wrong. There is zero empty statement in the code.
There is just one errored ExpStatement.
Run.dlang.io:
============
>Up to 2.074.1: Failure with output: onlineapp.d(3): Error: found 'return' > when expecting ';' following statement
> 2.075.1: Failure with output:
>-----
>onlineapp.d(3): Error: found 'return' when expecting ';' following statement
>onlineapp.d(3): Deprecation: use '{ }' for an empty statement, not a ';'
>-----
>Since 2.076.1: Failure with output:
>-----
>onlineapp.d(3): Error: found `return` when expecting `;` following statement
>onlineapp.d(3): Deprecation: use `{ }` for an empty statement, not `;`
>-----
the diagnostic was correct until 2.074.1
Comment #1 by dlang-bot — 2021-11-23T13:36:14Z
@RazvanN7 updated dlang/dmd pull request #13347 "Fix Issue 22529 - wrong deprecation about empty statement" fixing this issue:
- Fix Issue 22529 - wrong deprecation about empty statement
https://github.com/dlang/dmd/pull/13347
Comment #2 by dlang-bot — 2021-11-23T15:31:22Z
dlang/dmd pull request #13347 "Fix Issue 22529 - wrong deprecation about empty statement" was merged into stable:
- 3b992d25008caab9d0d183c86d5db1b8eb74ec9f by RazvanN7:
Fix Issue 22529 - wrong deprecation about empty statement
https://github.com/dlang/dmd/pull/13347
Comment #3 by dlang-bot — 2021-12-14T10:34:27Z
dlang/dmd pull request #13421 "merge stable" was merged into master:
- cb8329b4b1aff9e93f1c6c7dcf501714a1c82602 by Razvan Nitu:
Fix Issue 22529 - wrong deprecation about empty statement (#13347)
https://github.com/dlang/dmd/pull/13421