[clang] fix: compatible C++ empty record with align UB with gcc (PR #72197)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 15 11:33:06 PST 2023


================
@@ -65,3 +65,9 @@ EXTERNC struct SortOfEmpty sort_of_empty_ret(void) {
   struct SortOfEmpty e;
   return e;
 }
+
+// CHECK-GNU-CXX: define{{.*}} i32 @empty_align_arg(i128 %a.coerce, i32 noundef %b)
+struct EmptyAlign { long long int __attribute__((aligned)) : 0; };
+EXTERNC int empty_align_arg(struct EmptyAlign a, int b) {
+  return b;
+}
----------------
AaronBallman wrote:

Please add a newline at the end of the file.

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


More information about the cfe-commits mailing list