================
@@ -948,11 +948,48 @@ const auto throw_in_noexcept_lambda = [] () noexcept {
throw 42; };
// CHECK-MESSAGES: :[[@LINE-1]]:39: warning: an exception may be thrown in
function 'operator()' which should not throw exceptions
// CHECK-MESSAGES: :[[@LINE-2]]:56: note: frame #0: unhandled exception of
type 'int' may be thrown in function 'operator()' here
-void thrower() {
+int thrower() {
throw 42;
}
const auto indirect_throw_in_noexcept_lambda = [] () noexcept { thrower(); };
// CHECK-MESSAGES: :[[@LINE-1]]:48: warning: an exception may be thrown in
function 'operator()' which should not throw exceptions
// CHECK-MESSAGES: :[[@LINE-5]]:3: note: frame #0: unhandled exception of type
'int' may be thrown in function 'thrower' here
// CHECK-MESSAGES: :[[@LINE-3]]:65: note: frame #1: function 'operator()'
calls function 'thrower' here
+
+int f(int);
+void throw_in_function_arg() noexcept {
+// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: an exception may be thrown in
function 'throw_in_function_arg' which should not throw exceptions
+ f(false ? 0 : throw 1);
----------------
vbvictor wrote:
Can we add test with function of multiple arguments where final argument throws.
https://github.com/llvm/llvm-project/pull/165955
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits