[clang] [Clang] Fix missing diagnostic for non-standard layout type in `offsetof` (PR #65246)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 5 07:21:37 PDT 2023


================
@@ -25,6 +25,7 @@ struct B : public A {
 
 static_assert(__builtin_offsetof(B, d) == 12,
   "We can't allocate the bitfield into the padding under ms_struct");
+// expected-warning at -2 {{offset of on non-standard-layout type 'B'}}
----------------
AaronBallman wrote:

I think this diagnostic is an improvement over the status quo.

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


More information about the cfe-commits mailing list