Skip to content

Commit 193cfc1

Browse files
jensmaurertkoeppe
authored andcommitted
[diff.dcl] Discuss 'alignas' placement restrictions
1 parent 6a68232 commit 193cfc1

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

source/compatibility.tex

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2719,6 +2719,27 @@
27192719
Taking the size of an enumerator is not a
27202720
common C coding practice.
27212721

2722+
\diffref{dcl.align}
2723+
\change
2724+
In \Cpp{},
2725+
an \grammarterm{alignment-specifier} is an \grammarterm{attribute-specifier}.
2726+
In C, an \grammarterm{alignment-specifier} is a \gterm{declaration-specifier}.
2727+
2728+
Example:
2729+
\begin{codeblock}
2730+
#include <stdalign.h>
2731+
unsigned alignas(8) int x; // valid C, invalid \Cpp{}
2732+
unsigned int y alignas(8); // valid \Cpp{}, invalid C
2733+
\end{codeblock}
2734+
\rationale
2735+
\Cpp{} requires unambiguous placement of the \grammarterm{alignment-specifier}.
2736+
\effect
2737+
Deletion of semantically well-defined feature.
2738+
\difficulty
2739+
Syntactic transformation.
2740+
\howwide
2741+
Seldom.
2742+
27222743
\rSec2[diff.class]{\ref{class}: classes}
27232744

27242745
\diffref{class.name} [see also \ref{dcl.typedef}]

0 commit comments

Comments
 (0)