Skip to content

Commit 5cf9561

Browse files
committed
test throw in lambda
1 parent e0ca1f5 commit 5cf9561

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

clang-tools-extra/test/clang-tidy/checkers/bugprone/exception-escape.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,3 +928,7 @@ void no_throw_in_lambda_by_reference_capture(const copy_constructor_throws& a) n
928928
[&] { a; };
929929
[&a] {};
930930
}
931+
932+
const auto throw_in_noexcept_lambda = [] () noexcept { throw 42; };
933+
// CHECK-MESSAGES: :[[@LINE-1]]:39: warning: an exception may be thrown in function 'operator()' which should not throw exceptions
934+
// CHECK-MESSAGES: :[[@LINE-2]]:56: note: frame #0: unhandled exception of type 'int' may be thrown in function 'operator()' here

0 commit comments

Comments
 (0)