[clang] [analyzer] Model overflow builtins (PR #102602)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 30 05:02:04 PDT 2024


================
@@ -0,0 +1,30 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output text \
+// RUN:   -verify %s
+
+void test_no_overflow_note(int a, int b)
+{
+   int res;
+
+   if (__builtin_add_overflow(a, b, &res)) // expected-note {{Assuming overflow does not happen}}
----------------
NagyDonat wrote:

I agree that the phrasing suggested by @steakhal would be better, but I think that the original is also acceptable.

https://github.com/llvm/llvm-project/pull/102602


More information about the cfe-commits mailing list