[clang] aligned attribute doc (PR #195278)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon May 4 09:18:40 PDT 2026


================
@@ -10000,3 +9983,46 @@ different languages to coexist on the same call stack while each interpreting
 exceptions according to their own rules.
   }];
 }
+
+def AlignedDocs : Documentation {
+  let Category = DocCatDecl;
+  let Heading = "aligned";
+  let Content = [{
+The ``aligned`` attribute specifies a minimum alignment (in bytes) for a 
+variable, structure field, or type definition. The attribute takes an 
+optional non-negative integral constant expression. If the value is a 
+power of two, the compiler ensures the declaration is aligned to at least 
+that boundary; a value of zero has no effect.
----------------
AaronBallman wrote:

```suggestion
that boundary; a value of zero has no effect on the alignment chosen at runtime.
```
https://godbolt.org/z/731rnG1Ma shows it does have *some* effect.
https://godbolt.org/z/rMoPWx871 shows that it doesn't have effects on the alignment itself.


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


More information about the cfe-commits mailing list