[PATCH] D150528: [Clang] Fix the diagnoses when the argument to alignas is an incomplete type

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 15 06:36:06 PDT 2023


aaron.ballman added a comment.

Thank you for working on this! Just a few minor things.



================
Comment at: clang/docs/ReleaseNotes.rst:279-281
+- Clang now correctly diagnoses when the argument to alignas is an incomplete type.
+  (`#55175: <https://github.com/llvm/llvm-project/issues/55175>`_,
+  Incorrect mention of 'alignof' in a diagnostic about 'alignas').
----------------



================
Comment at: clang/lib/Parse/ParseDecl.cpp:3032
+  ExprResult ArgExpr =
+      ParseAlignArgument(KWName->getName(), T.getOpenLocation(), EllipsisLoc);
   if (ArgExpr.isInvalid()) {
----------------



================
Comment at: clang/lib/Sema/SemaExpr.cpp:4714
+/// [dcl.align] An alignment-specifier of the form alignas(type-id) has the same
+/// effect as alignas(​alignof(type-id)).
+ExprResult Sema::ActOnAlignasTypeArgument(StringRef KWName, ParsedType Ty,
----------------
It looks like a zero-width joiner was added here around the `!` that should be removed.


================
Comment at: clang/lib/Sema/SemaExpr.cpp:4720
+                          &TInfo);
+  return CreateUnaryExprOrTypeTraitExpr(TInfo, OpLoc, UETT_AlignOf, KWName, R);
+}
----------------



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