From 34886d135cec62883e76ba25bda34b4623e4a696 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Wed, 1 Feb 2017 14:56:21 +0100 Subject: Change the syntax to gcc/clangs syntax. This only means that there must be one identifier at the begining and then a designator. Bug 20765 --- cparser/Parser.vy | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cparser/Parser.vy') diff --git a/cparser/Parser.vy b/cparser/Parser.vy index f6bd6a7e..7fe686f1 100644 --- a/cparser/Parser.vy +++ b/cparser/Parser.vy @@ -145,8 +145,10 @@ postfix_expression: { (CAST typ (COMPOUND_INIT (rev' init)), loc) } | loc = LPAREN typ = type_name RPAREN LBRACE init = initializer_list COMMA RBRACE { (CAST typ (COMPOUND_INIT (rev' init)), loc) } -| loc = BUILTIN_OFFSETOF LPAREN typ = type_name COMMA mem = designator_list RPAREN - { (BUILTIN_OFFSETOF typ (rev mem), loc) } +| loc = BUILTIN_OFFSETOF LPAREN typ = type_name COMMA id = OTHER_NAME mems = designator_list RPAREN + { (BUILTIN_OFFSETOF typ ((INFIELD_INIT (fst id))::(rev mems)), loc) } +| loc = BUILTIN_OFFSETOF LPAREN typ = type_name COMMA mem = OTHER_NAME RPAREN + { (BUILTIN_OFFSETOF typ [INFIELD_INIT (fst mem)], loc) } (* Semantic value is in reverse order. *) argument_expression_list: -- cgit