Skip to content

[clang] label diagnosed as unused when used with break and/or continue (C2Y named loop) #166013

@olemayu

Description

@olemayu

https://godbolt.org/z/9bE1Yv4s9

loop: // warning: unused label 'loop' [-Wunused-label]
while (true) {
    Event event;

    while (PollEvent(&event)) {
        if (event.type == EVENT_QUIT) {
            break loop;
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    c2yclang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerconfirmedVerified by a second party

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions