================
@@ -1268,6 +1268,14 @@ ItaniumRecordLayoutBuilder::LayoutBase(const 
BaseSubobjectInfo *Base) {
     UnpackedAlignTo = std::min(UnpackedAlignTo, MaxFieldAlignment);
   }
 
+  CharUnits MaxAlignmentInChars =
+      Context.toCharUnitsFromBits(Base->Class->getMaxAlignment());
+  if (!MaxAlignmentInChars.isZero() && MaxAlignmentInChars > BaseAlign) {
+    Diag(Base->Class->getLocation(), diag::warn_explicit_alignment_weakened)
+        << Base->Class->getName() << MaxAlignmentInChars.getQuantity()
----------------
AaronBallman wrote:

```suggestion
        << Base->Class << MaxAlignmentInChars.getQuantity()
```
You can pass in any `NamedDecl *` and the diagnostics engine will properly 
determine how to display it (including quoting, etc).

https://github.com/llvm/llvm-project/pull/198417
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to