[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
+  // TODO : Find a way to replace `offsetof` ?
+  _LIBCPP_DIAGNOSTIC_PUSH
+  _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Winvalid-offsetof")
+  _LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Winvalid-offsetof")
----------------
philnik777 wrote:

GCC doesn't warn on this, so we shouldn't suppress anything here.

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


More information about the cfe-commits mailing list