================
@@ -0,0 +1,64 @@
+// RUN: %clang_cc1 -fsyntax-only -triple x86_64-linux-gnu -fpack-struct=1
-DPACK_STRUCT -verify=pack-struct %s
+// RUN: %clang_cc1 -fsyntax-only -triple i386-apple-darwin -DMAC68K
-verify=mac68k %s
+// RUN: %clang_cc1 -fsyntax-only -triple x86_64-linux-gnu -target-feature
+avx512f -DPACK16 -verify=itanium %s
+// RUN: %clang_cc1 -fsyntax-only -triple x86_64-windows-msvc -target-feature
+avx512f -DPACK16 -verify=ms %s
+
+extern void f1(int *);
+
+#ifdef PACK_STRUCT
+struct S {
+ char c;
+ int x;
+};
+
+void g0(struct S *p) {
+ f1(&p->x); // pack-struct-warning {{packed member 'x' of class or structure
'S'}}
----------------
Endilll wrote:
It's out of scope of this PR, but I don't particularly like the wording of the
existing diagnostic. I'd prefer something along the lines of `taking address of
a packed member [. . .]` at very least, if not followed by `; this can result
in an invalid pointer`.
https://github.com/llvm/llvm-project/pull/219096
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits