[clang] [C23] Fix handling of alignas (PR #81637)

via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 13 09:59:25 PST 2024


================
@@ -114,6 +114,19 @@ C Language Changes
 C23 Feature Support
 ^^^^^^^^^^^^^^^^^^^
 
+- Corrected parsing behavior for the ``alignas`` specifier/qualifier in C23. We
+  previously handled it as an attribute as in C++, but there are parsing
+  differences. The behavioral differences are:
+
+  .. code-block:: c
+
+     struct alignas(8) /* was accepted, now rejected */ S {
+       char alignas(8) /* was rejected, now accepted */ C;
+     };
+     int i alignas(8) /* was accepted, now rejected */ ;
+
+  Fixes (`#81472 <https://github.com/llvm/llvm-project/issues/81472>`_).
+
----------------
cor3ntin wrote:

Should that be in the breaking change section?

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


More information about the cfe-commits mailing list