mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 05:00:16 +03:00
Remove deprecation for bugzilla 22999 (#16800)
This commit is contained in:
parent
a74614204e
commit
0276d7e50a
3 changed files with 22 additions and 10 deletions
18
changelog/dmd.deprecation-case.dd
Normal file
18
changelog/dmd.deprecation-case.dd
Normal file
|
@ -0,0 +1,18 @@
|
|||
An error is now given for case fallthough for multivalued cases
|
||||
|
||||
This used to give a deprecation, this now gives an error:
|
||||
```
|
||||
int i;
|
||||
switch (0)
|
||||
{
|
||||
case 0, 1: i = 20;
|
||||
default: assert(0); // Error: switch case fallthrough - use 'goto default;' if intended
|
||||
}
|
||||
|
||||
switch (0)
|
||||
{
|
||||
default:
|
||||
case 0, 1: i = 20;
|
||||
case 2, 3: i = 30; // Error: switch case fallthrough - use 'goto case;' if intended
|
||||
}
|
||||
```
|
|
@ -140,13 +140,8 @@ int blockExit(Statement s, FuncDeclaration func, ErrorSink eSink)
|
|||
else if (func.getModule().filetype != FileType.c)
|
||||
{
|
||||
const(char)* gototype = s.isCaseStatement() ? "case" : "default";
|
||||
// @@@DEPRECATED_2.110@@@ https://issues.dlang.org/show_bug.cgi?id=22999
|
||||
// Deprecated in 2.100
|
||||
// Make an error in 2.110
|
||||
if (sl && sl.isCaseStatement())
|
||||
global.errorSink.deprecation(s.loc, "switch case fallthrough - use 'goto %s;' if intended", gototype);
|
||||
else
|
||||
global.errorSink.error(s.loc, "switch case fallthrough - use 'goto %s;' if intended", gototype);
|
||||
// https://issues.dlang.org/show_bug.cgi?id=22999
|
||||
global.errorSink.error(s.loc, "switch case fallthrough - use 'goto %s;' if intended", gototype);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
/*
|
||||
REQUIRED_ARGS: -de
|
||||
TEST_OUTPUT:
|
||||
---
|
||||
fail_compilation/test22999.d(18): Deprecation: switch case fallthrough - use 'goto default;' if intended
|
||||
fail_compilation/test22999.d(25): Deprecation: switch case fallthrough - use 'goto case;' if intended
|
||||
fail_compilation/test22999.d(17): Error: switch case fallthrough - use 'goto default;' if intended
|
||||
fail_compilation/test22999.d(24): Error: switch case fallthrough - use 'goto case;' if intended
|
||||
---
|
||||
*/
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue