jerinphilip wrote:

I have rebased the PR with main (which appears to fix the formatting workflow). 
For the time being, I have left the C23 test using `alignas` in with the active 
error message and a `FIXME`.

I've altered the state of this PR to be close to 
[D141177](https://reviews.llvm.org/D141177), using the existing attribute 
warning for reduced complexity (happy to provide attribution). Key difference 
`isAlignas` instead of `isC23AlignasAttribute()`, thinking the former should be 
more future-proof. In the current state, `isCXX11Attribute()` and 
`isStandardAttributeSyntax()` is not modified, and the net improvement (in 
diagnostics) in changes here should be useful when C23 `alignas` comes in, I 
hope.

The following routes were also considered:

1. Store `tok::TokenKind` to resolve `_Alignas` vs `alignas`. This requires 
adding one more field to `Form` and `AttributeCommonInfo`, while the 
information is already present via (`IsAlignas`, `SpellingIndex`) tuple (This 
approach is in 
[jerinphilip/llvm-project#1](https://github.com/jerinphilip/llvm-project/pull/1)
 mixed with other things). 
2. Use `calculateAttributeSpellingIndex` (also discussed in meeting). This 
suffers from inability to use `AlignedAttr::Keyword_Alignas` 
(`clang/AST/Attrs.h`) - See [#65638 
(comment)](https://github.com/llvm/llvm-project/pull/65638#discussion_r1367880789).
 Absent this, the `SpellingIndex` value `5` (`Keyword_Alignas`) will have to be 
maintained separately here to resolve `_Alignas`. Looking at the source 
requires string operations, which are inefficient.

https://github.com/llvm/llvm-project/pull/65638
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to