Skip to content

Apply proper source location to fallthrough switch cases. #3271

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

Merged
merged 1 commit into from
Sep 21, 2021

Conversation

rastogishubham
Copy link

@swift-ci test

This fixes a bug in clang where, when clang sees a switch with a
fallthrough to a default like this:

static void funcA(void) {}
static void funcB(void) {}

int main(int argc, char **argv) {

switch (argc) {
    case 0:
        funcA();
        break;
    case 10:
    default:
        funcB();
        break;
}
}

It does not add a proper debug location for that switch case, such as
case 10: above.

Patch by Shubham Rastogi!

Differential Revision: https://reviews.llvm.org/D109940

(cherry picked from commit 843390c)
@adrian-prantl
Copy link

Did you mean to create this PR against stable/20210726 instead of next?

@rastogishubham rastogishubham changed the base branch from next to stable/20210726 September 21, 2021 16:28
@adrian-prantl
Copy link

@swift-ci test

@rastogishubham rastogishubham merged commit fe2172a into swiftlang:stable/20210726 Sep 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants