[PATCH] D150528: [Clang][Attribute] Improve the AST/diagnoses fidelity of alignas and _Alignas

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 25 07:53:56 PDT 2023


erichkeane accepted this revision.
erichkeane added a comment.
This revision is now accepted and ready to land.

1 nit I don't care either way about, 1 suggestion.



================
Comment at: clang/lib/AST/AttrImpl.cpp:247
+
+  if (isAlignmentExpr()) {
+    return alignmentExpr
----------------
Typically we don't do curleys on a single-statement... but I am on the fence due to how complicated it is below.


================
Comment at: clang/lib/AST/AttrImpl.cpp:259
+  //     alignment of the referenced type.
+  if (const ReferenceType *Ref = T->getAs<ReferenceType>())
+    T = Ref->getPointeeType();
----------------
You can replace this 'if' with: `T = T->getNonReferenceType();`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150528/new/

https://reviews.llvm.org/D150528



More information about the cfe-commits mailing list