[clang] Add an off-by-default warning to complain about MSVC bitfield padding (PR #117428)

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 26 11:29:21 PST 2024


================
@@ -19001,9 +19001,9 @@ void Sema::ActOnFields(Scope *S, SourceLocation RecLoc, Decl *EnclosingDecl,
 
   // Verify that all the fields are okay.
   SmallVector<FieldDecl*, 32> RecFields;
-
+  std::optional<const FieldDecl *> PreviousField;
----------------
rnk wrote:

It doesn't seem idiomatic to use an optional pointer, when nullable pointers are built into the language. Consider helping to reduce our collective carbon footprint by saving an extra template instantiation today, and using nullptr instead. =D

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


More information about the cfe-commits mailing list