+2018-12-19 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * c-parser.c (c_parser_asm_statement) <RID_CONST, RID_RESTRICT>: Give
+ a more specific error message (instead of just falling through).
+
2018-12-19 Segher Boessenkool <segher@kernel.crashing.org>
* c-parser.c (c_parser_asm_statement): Keep track of the location each
+2018-12-19 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * parser.c (cp_parser_asm_definition) <RID_CONST, RID_RESTRICT>: Give
+ a more specific error message (instead of just falling through).
+
2018-12-19 Segher Boessenkool <segher@kernel.crashing.org>
* parser.c (cp_parser_asm_definition): Rewrite the loop to work without
--- /dev/null
+// Test that qualifiers on asm are allowed in any order.
+// { dg-do compile }
+// { dg-options "-std=c++98" }
+
+void
+f ()
+{
+ asm volatile goto ("" :::: lab);
+ asm volatile inline ("" :::);
+ asm inline volatile ("" :::);
+ asm inline goto ("" :::: lab);
+ asm goto volatile ("" :::: lab);
+ asm goto inline ("" :::: lab);
+
+ asm volatile inline goto ("" :::: lab);
+ asm volatile goto inline ("" :::: lab);
+ asm inline volatile goto ("" :::: lab);
+ asm inline goto volatile ("" :::: lab);
+ asm goto volatile inline ("" :::: lab);
+ asm goto inline volatile ("" :::: lab);
+
+ /* Duplicates are not allowed. */
+ asm goto volatile volatile ("" :::: lab); /* { dg-error "" } */
+ asm volatile goto volatile ("" :::: lab); /* { dg-error "" } */
+ asm volatile volatile goto ("" :::: lab); /* { dg-error "" } */
+ asm goto goto volatile ("" :::: lab); /* { dg-error "" } */
+ asm goto volatile goto ("" :::: lab); /* { dg-error "" } */
+ asm volatile goto goto ("" :::: lab); /* { dg-error "" } */
+
+ asm inline volatile volatile ("" :::); /* { dg-error "" } */
+ asm volatile inline volatile ("" :::); /* { dg-error "" } */
+ asm volatile volatile inline ("" :::); /* { dg-error "" } */
+ asm inline inline volatile ("" :::); /* { dg-error "" } */
+ asm inline volatile inline ("" :::); /* { dg-error "" } */
+ asm volatile inline inline ("" :::); /* { dg-error "" } */
+
+ asm goto inline inline ("" :::: lab); /* { dg-error "" } */
+ asm inline goto inline ("" :::: lab); /* { dg-error "" } */
+ asm inline inline goto ("" :::: lab); /* { dg-error "" } */
+ asm goto goto inline ("" :::: lab); /* { dg-error "" } */
+ asm goto inline goto ("" :::: lab); /* { dg-error "" } */
+ asm inline goto goto ("" :::: lab); /* { dg-error "" } */
+
+lab:
+ ;
+}
{
asm volatile ("");
- asm const (""); /* { dg-error {expected '\(' before 'const'} } */
- /* { dg-error {expected identifier} {} {target *-*-*} .-1 } */
+ asm const (""); /* { dg-error {'const' is not an asm qualifier} } */
- asm restrict (""); /* { dg-error {expected '\(' before 'restrict'} } */
- /* { dg-error {expected identifier} {} {target *-*-*} .-1 } */
+ asm restrict (""); /* { dg-error {'restrict' is not an asm qualifier} } */
}