c/c++, asm: Use nicer error for duplicate asm qualifiers
authorSegher Boessenkool <segher@kernel.crashing.org>
Wed, 19 Dec 2018 16:12:17 +0000 (17:12 +0100)
committerSegher Boessenkool <segher@gcc.gnu.org>
Wed, 19 Dec 2018 16:12:17 +0000 (17:12 +0100)
commitdb4fd626ee2bb431adadddf5eca5fba104cea5ca
tree1a0695e86a028584e80b85b341d91e2c3755519c
parent9c9cfcbbbe659d16a216883ff9a9bcb098e243f0
c/c++, asm: Use nicer error for duplicate asm qualifiers

Also as suggested by Jason.

c/
* c-parser.c (c_parser_asm_statement): Keep track of the location each
asm qualifier is first seen; use that to give nicer "duplicate asm
qualifier" messages.  Delete 'quals" variable, instead pass the
"is_volatile_ flag to build_asm_stmt directly.
* c-tree.h (build_asm_stmt): Make the first arg bool instead of tree.
* c-typeck.c (build_asm_stmt): Ditto; adjust.

cp/
* parser.c (cp_parser_asm_definition): Rewrite the loop to work without
"done" boolean variable.
* parser.c (cp_parser_asm_definition): Keep track of the location each
asm qualifier is first seen; use that to give nicer "duplicate asm
qualifier" messages.

From-SVN: r267278
gcc/c/ChangeLog
gcc/c/c-parser.c
gcc/c/c-tree.h
gcc/c/c-typeck.c
gcc/cp/ChangeLog
gcc/cp/parser.c