[clang] [clang] Improve `_Alignas` on a `struct` declaration diagnostic (PR #65638)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 1 07:53:37 PDT 2023


================
@@ -192,6 +192,13 @@ class AttributeCommonInfo {
 
   bool isC23Attribute() const { return SyntaxUsed == AS_C23; }
 
+  bool isAlignas() const {
+    // In the current state of code, IsAlignas is only configured to return
----------------
AaronBallman wrote:

How about:
```
// FIXME: In the current state, the IsAlignas member variable is only true with the C++
// `alignas` keyword but not `_Alignas`. The following expression works around the
// otherwise lost information so it will return true for `alignas` or `_Alignas` while still
// returning false for things like `__attribute__((aligned))`.
```

https://github.com/llvm/llvm-project/pull/65638


More information about the cfe-commits mailing list