[clang] [clang] Respect field alignment in layout compatibility of structs (PR #84313)

via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 7 04:40:20 PST 2024


================
@@ -19185,7 +19185,8 @@ static bool isLayoutCompatible(ASTContext &C, EnumDecl *ED1, EnumDecl *ED2) {
 
 /// Check if two fields are layout-compatible.
 static bool isLayoutCompatible(ASTContext &C, FieldDecl *Field1,
-                               FieldDecl *Field2) {
+                               FieldDecl *Field2,
+                               bool IgnoreAlignment = false) {
----------------
cor3ntin wrote:

I think I would prefer calling that `IsUnionMember` or something like that (and reverse the condition everywhere)

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


More information about the cfe-commits mailing list