Skip to content

[clang-tidy] False positive bugprone-exception-escape for throwing lambda in noexcept function #132605

Open
@Eisenwave

Description

@Eisenwave

https://godbolt.org/z/1sf8Gne35

void awoo() noexcept {
    [] { throw 0; };
}

This outputs

<source>:1:6: warning: an exception may be thrown in function 'awoo' which should not throw exceptions [bugprone-exception-escape]
    1 | void awoo() noexcept {
      |      ^

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions