[clang] [clang] Implement CWG2759 "`[[no_unique_address]` and common initial sequence" (PR #82607)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 22 03:43:50 PST 2024


================
@@ -19033,6 +19033,11 @@ static bool isLayoutCompatible(ASTContext &C, FieldDecl *Field1,
       return false;
   }
 
+  if (Field1->hasAttr<clang::NoUniqueAddressAttr>() ||
+      Field2->hasAttr<clang::NoUniqueAddressAttr>()) {
+    return false;
+  }
+
----------------
tbaederr wrote:

```suggestion
  if (Field1->hasAttr<clang::NoUniqueAddressAttr>() ||
      Field2->hasAttr<clang::NoUniqueAddressAttr>()) 
    return false;
```

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


More information about the cfe-commits mailing list