parser.c (cp_parser_asm_definition): Correct handling of omitted operands.

* parser.c (cp_parser_asm_definition): Correct handling of omitted
	operands.

	* g++.dg/ext/asm4.C: New test.

From-SVN: r61048
This commit is contained in:
Mark Mitchell 2003-01-08 16:59:31 +00:00 committed by Mark Mitchell
parent 918c4fe41e
commit 8caf4c38d8
4 changed files with 22 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2003-01-07 Mark Mitchell <mark@codesourcery.com>
* parser.c (cp_parser_asm_definition): Correct handling of omitted
operands.
2003-01-08 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/9030

View File

@ -9592,7 +9592,9 @@ cp_parser_asm_definition (parser)
if (cp_lexer_next_token_is_not (parser->lexer,
CPP_COLON)
&& cp_lexer_next_token_is_not (parser->lexer,
CPP_SCOPE))
CPP_SCOPE)
&& cp_lexer_next_token_is_not (parser->lexer,
CPP_CLOSE_PAREN))
outputs = cp_parser_asm_operand_list (parser);
}
/* If the next token is `::', there are no outputs, and the
@ -9616,7 +9618,9 @@ cp_parser_asm_definition (parser)
if (cp_lexer_next_token_is_not (parser->lexer,
CPP_COLON)
&& cp_lexer_next_token_is_not (parser->lexer,
CPP_SCOPE))
CPP_SCOPE)
&& cp_lexer_next_token_is_not (parser->lexer,
CPP_CLOSE_PAREN))
inputs = cp_parser_asm_operand_list (parser);
}
else if (cp_lexer_next_token_is (parser->lexer, CPP_SCOPE))
@ -9631,7 +9635,9 @@ cp_parser_asm_definition (parser)
/* Consume the `:'. */
cp_lexer_consume_token (parser->lexer);
/* Parse the clobbers. */
clobbers = cp_parser_asm_clobber_list (parser);
if (cp_lexer_next_token_is_not (parser->lexer,
CPP_CLOSE_PAREN))
clobbers = cp_parser_asm_clobber_list (parser);
}
}
/* Look for the closing `)'. */

View File

@ -1,3 +1,7 @@
2003-01-07 Mark Mitchell <mark@codesourcery.com>
* g++.dg/ext/asm4.C: New test.
2003-01-08 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/9030

View File

@ -0,0 +1,4 @@
void f ()
{
__asm__ __volatile__ ("" : : );
}