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

Yurong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 15 08:56:02 PDT 2023


yronglin marked 2 inline comments as done.
yronglin added a comment.

In D150528#4342600 <https://reviews.llvm.org/D150528#4342600>, @aaron.ballman wrote:

> In D150528#4342535 <https://reviews.llvm.org/D150528#4342535>, @yronglin wrote:
>
>> Thanks a lot for your review @aaron.ballman ! BTW, does the most good approach is that we just add a new `ParsedAttribute` with `TypeSourceInfo` but not an `UnaryExprOrTypeTraitExpr`, and only do a sema check same as `alignof(type-id)`?
>
> Because you've already got a `ParsedAttr`, I think you'd use this constructor: https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Sema/ParsedAttr.h#L274 and move the call to `GetTypeFromParser()` until later, but it should still be modelled as a `UnaryExprOrTypeTraitExpr`.

Many thanks for the tips, I think the next step is to build `UnaryExprOrTypeTraitExpr ` in this place (https://github.com/llvm/llvm-project/blob/9715af434579022b5ef31781be40b722d7e63bee/clang/lib/Sema/SemaDeclAttr.cpp#L4335-L4358) and then calculate the alignment? If this approach is correct, I'm glad to investigate it.


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