[clang] [Sema] Fix crash in __builtin_dump_struct with -Werror -Wformat-pedantic (PR #212377)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 28 23:14:45 PDT 2026


================
@@ -0,0 +1,14 @@
+// RUN: not %clang_cc1 -Wformat-pedantic -Werror -emit-llvm -o /dev/null %s 2>&1 | FileCheck %s
+
+int printflike(const char *__restrict__ x, ...) __attribute__((__format__(__printf__, 1, 2)));
+
+struct Foo {
+    int *x;
+};
+
+void test() {
+    __builtin_dump_struct(&(struct Foo){0}, printflike);
+}
+
+// CHECK: error: format specifies type 'void *' but the argument has type 'int *'
----------------
zyn0217 wrote:

Can we `-verify` diagnostics so we can also ensure source locations? thanks

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


More information about the cfe-commits mailing list