aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-exp.y
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/c-exp.y')
-rw-r--r--gdb/c-exp.y8
1 files changed, 7 insertions, 1 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 9e2f808..3cee544 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -173,7 +173,7 @@ static void c_print_token (FILE *file, int type, YYSTYPE value);
%token <ssym> NAME_OR_INT
%token OPERATOR
-%token STRUCT CLASS UNION ENUM SIZEOF UNSIGNED COLONCOLON
+%token STRUCT CLASS UNION ENUM SIZEOF ALIGNOF UNSIGNED COLONCOLON
%token TEMPLATE
%token ERROR
%token NEW DELETE
@@ -307,6 +307,10 @@ exp : SIZEOF exp %prec UNARY
{ write_exp_elt_opcode (pstate, UNOP_SIZEOF); }
;
+exp : ALIGNOF '(' type_exp ')' %prec UNARY
+ { write_exp_elt_opcode (pstate, UNOP_ALIGNOF); }
+ ;
+
exp : exp ARROW name
{ write_exp_elt_opcode (pstate, STRUCTOP_PTR);
write_exp_string (pstate, $3);
@@ -2329,6 +2333,8 @@ static const struct token ident_tokens[] =
{"struct", STRUCT, OP_NULL, 0},
{"signed", SIGNED_KEYWORD, OP_NULL, 0},
{"sizeof", SIZEOF, OP_NULL, 0},
+ {"_Alignof", ALIGNOF, OP_NULL, 0},
+ {"alignof", ALIGNOF, OP_NULL, FLAG_CXX},
{"double", DOUBLE_KEYWORD, OP_NULL, 0},
{"false", FALSEKEYWORD, OP_NULL, FLAG_CXX},
{"class", CLASS, OP_NULL, FLAG_CXX},