================
@@ -141,6 +141,42 @@ void
nullable_value_after_swap(BloombergLP::bdlb::NullableValue<int> &opt1, Bloo
}
}
+void assertion_handler_imp() __attribute__((analyzer_noreturn));
+
+void assertion_handler() {
+ do {
+ assertion_handler_imp();
+ } while(0);
+}
+
+void function_calling_analyzer_noreturn(const bsl::optional<int>& opt)
+{
+ if (!opt) {
+ assertion_handler();
+ }
+
+ *opt; // no-warning
----------------
negativ wrote:
Anyway, i consider moving this kind of check to
`clang\unittests\Analysis\FlowSensitive\UncheckedOptionalAccessModelTest.cpp`
https://github.com/llvm/llvm-project/pull/146355
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits