xref: /llvm-project/clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape-consteval.cpp (revision fd2e0483de089fb1459bf440d74e5b4e648a429f)
1 // RUN: %check_clang_tidy -std=c++20 %s bugprone-exception-escape %t -- \
2 // RUN:     -- -fexceptions -Wno-everything
3 
4 namespace GH104457 {
5 
6 consteval int consteval_fn(int a) {
7   if (a == 0)
8     throw 1;
9   return a;
10 }
11 
12 int test() noexcept { return consteval_fn(1); }
13 
14 } // namespace GH104457
15