From: Jan Beulich Date: Thu, 12 Aug 2004 09:34:16 +0000 (+0000) Subject: parser.c (cp_parser_asm_definition): Properly consume scope operator tokens preceding... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bf5930d4970a2202ebb6f4be70ea49678ef7cd6d;p=gcc.git parser.c (cp_parser_asm_definition): Properly consume scope operator tokens preceding the clobbers. cp/ 2004-08-12 Jan Beulich * parser.c (cp_parser_asm_definition): Properly consume scope operator tokens preceding the clobbers. Don't check for scope operator following inputs. Simplify inputs handling to match that now used for clobbers. testsuite/ 2004-08-12 Jan Beulich * g++.dg/ext/asm5.C: New. From-SVN: r85860 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 2bc5a854100..a80e8d2bad4 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2004-08-12 Jan Beulich + + * parser.c (cp_parser_asm_definition): Properly consume scope operator + tokens preceding the clobbers. Don't check for scope operator + following inputs. Simplify inputs handling to match that now used for + clobbers. + 2004-08-11 Mark Mitchell PR c++/16698 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index a8854dcad2d..2193bacc3e6 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -10367,25 +10367,18 @@ cp_parser_asm_definition (cp_parser* parser) /* If the next token is `::', there are no outputs, and the next token is the beginning of the inputs. */ else if (cp_lexer_next_token_is (parser->lexer, CPP_SCOPE)) - { - /* Consume the `::' token. */ - cp_lexer_consume_token (parser->lexer); - /* The inputs are coming next. */ - inputs_p = true; - } + /* The inputs are coming next. */ + inputs_p = true; /* Look for inputs. */ if (inputs_p || cp_lexer_next_token_is (parser->lexer, CPP_COLON)) { - if (!inputs_p) - /* Consume the `:'. */ - cp_lexer_consume_token (parser->lexer); + /* Consume the `:' or `::'. */ + cp_lexer_consume_token (parser->lexer); /* Parse the output-operands. */ if (cp_lexer_next_token_is_not (parser->lexer, CPP_COLON) - && cp_lexer_next_token_is_not (parser->lexer, - CPP_SCOPE) && cp_lexer_next_token_is_not (parser->lexer, CPP_CLOSE_PAREN)) inputs = cp_parser_asm_operand_list (parser); @@ -10398,9 +10391,8 @@ cp_parser_asm_definition (cp_parser* parser) if (clobbers_p || cp_lexer_next_token_is (parser->lexer, CPP_COLON)) { - if (!clobbers_p) - /* Consume the `:'. */ - cp_lexer_consume_token (parser->lexer); + /* Consume the `:' or `::'. */ + cp_lexer_consume_token (parser->lexer); /* Parse the clobbers. */ if (cp_lexer_next_token_is_not (parser->lexer, CPP_CLOSE_PAREN)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 93a6e56c99a..cf258754eac 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2004-08-12 Jan Beulich + + * g++.dg/ext/asm5.C: New. + 2004-08-11 Mark Mitchell PR c++/16698