[clang] [Clang] Add wraps attribute (for granular integer overflow handling) (PR #86618)

Justin Stitt via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 22 16:28:07 PDT 2024


================
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 %s -verify -fsyntax-only -triple x86_64-pc-linux-gnu
+// expected-no-diagnostics
+typedef int __attribute__((wraps)) wrapping_int;
+
+void foo(void) {
+  const wrapping_int A = 1;
+  int D = 2147483647 + A;
----------------
JustinStitt wrote:

OK, fixed in 1aa85e159d5768a7059bb35e457af28a3753bf66

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


More information about the cfe-commits mailing list