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

via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 29 05:21:29 PDT 2023


================
@@ -47,7 +47,13 @@ struct __libcpp_datasizeof {
   };
 #endif
 
+  // Disable warnings related to the use of `offsetof` on non-standard layout or non-POD types
----------------
philnik777 wrote:

```suggestion
  // _FirstPaddingByte<> is sometimes non-standard layout. Using `offsetof` is UB in that case, but GCC and Clang allow the use as an extension.
```

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


More information about the cfe-commits mailing list