We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ace3808 commit 243fe3bCopy full SHA for 243fe3b
docs/error-messages/compiler-errors-1/compiler-error-c2024.md
@@ -12,3 +12,22 @@ helpviewer_keywords: ["C2024"]
12
The compiler found an **`alignas`** specifier applied to a function or other type that can't be aligned.
13
14
To resolve this error, remove the **`alignas`** specifier.
15
+
16
+The following sample generates C2024:
17
18
+```cpp
19
+// C2024.cpp
20
+namespace alignas(2) ns { // C2024
21
+ void func(alignas(8) int x) {} // C2024
22
+}
23
+```
24
25
+Possible resolution:
26
27
28
+// C2024b.cpp
29
+// compile with: /c
30
+namespace ns {
31
+ void func(int x) {}
32
33
0 commit comments