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

Oliver Hunt via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 26 16:41:35 PST 2024


================
@@ -19213,6 +19213,29 @@ void Sema::ActOnFields(Scope *S, SourceLocation RecLoc, Decl *EnclosingDecl,
 
     if (Record && FD->getType().isVolatileQualified())
       Record->setHasVolatileMember(true);
+    auto IsNonDependentBitField = [](const FieldDecl *FD) {
+      if (!FD->isBitField())
+        return false;
+      if (FD->getType()->isDependentType())
+        return false;
+      return true;
----------------
ojhunt wrote:

I think I did this intentionally as I sometimes feel like explicit true/false returns are clearer, I'm happy with either Aaron or @Sirraide's suggestion but I want to confirm that others don't have my clarity concerns :D

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


More information about the cfe-commits mailing list