www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22415] New: importC: Deprecation: switch case fallthrough -

https://issues.dlang.org/show_bug.cgi?id=22415

          Issue ID: 22415
           Summary: importC: Deprecation: switch case fallthrough - use
                    'goto case;' if intended
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ibuclaw gdcproject.org

Deprecation warning is D-specific, and doesn't apply to C11 semantic rules.
---
int test(int a)
{
    switch (a)
    {
        case 0:
            a = 1;
        case 1:
            return a;
        case 2:
        default:
            return -1;
    }
}

--
Oct 17 2021