@@ -617,6 +617,7 @@ static struct token *unary_expression(struct token *token, struct expression **t
{ &sizeof_ident, EXPR_SIZEOF },
{ &__alignof___ident, EXPR_ALIGNOF },
{ &__alignof_ident, EXPR_ALIGNOF },
+ { &_Alignof_ident, EXPR_ALIGNOF },
{ &__sizeof_ptr___ident, EXPR_PTRSIZEOF },
};
int i;
@@ -31,6 +31,7 @@ IDENT(L);
/* Extended gcc identifiers */
IDENT(asm); IDENT_RESERVED(__asm); IDENT_RESERVED(__asm__);
IDENT(alignof); IDENT_RESERVED(__alignof); IDENT_RESERVED(__alignof__);
+IDENT_RESERVED(_Alignof);
IDENT_RESERVED(__sizeof_ptr__);
IDENT_RESERVED(__builtin_types_compatible_p);
IDENT_RESERVED(__builtin_offsetof);
new file mode 100644
@@ -0,0 +1,12 @@
+static int foo(void)
+{
+ return _Alignof(short);
+}
+
+/*
+ * check-name: c11-alignof
+ * check-command: test-linearize -std=c11 $file
+ *
+ * check-output-ignore
+ * check-output-contains: ret\\.32 *\$2
+ */
This is a new name for GCC's '__alignof()' operator which was already supported. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- expression.c | 1 + ident-list.h | 1 + validation/c11-alignof.c | 12 ++++++++++++ 3 files changed, 14 insertions(+) create mode 100644 validation/c11-alignof.c