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

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 26 11:08:27 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;
----------------
AaronBallman wrote:

```suggestion
      return !FD->getType()->isDependentType();
```

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


More information about the cfe-commits mailing list