Issue 240835
Summary [clang-tidy] False positive bugprone-throwing-static-initialization
Labels clang-tidy
Assignees
Reporter etikhenko
    Hello!
After the latest MSYS2 update, I started getting warnings from clang-tidy about “bugprone-throwing-static-initialization” that I couldn't fix, so I ended up putting together a minimal code example that clearly shouldn't trigger such a warning.

```c++
constexpr auto zero() -> int
{
    return 0;
}

static const int variable = zero();

auto main() -> int
{
    (void)variable;
}
```

<img width="1201" height="552" alt="Image" src="" />

If I declare `static constexpr int variable`, the error disappears, but it shouldn't be there in the first place, since no exception can occur in this code.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to