]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Emit error with old asm syntax in new asm blocks
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Wed, 9 Apr 2025 15:41:24 +0000 (17:41 +0200)
committerP-E-P <32375388+P-E-P@users.noreply.github.com>
Thu, 17 Apr 2025 18:05:17 +0000 (18:05 +0000)
gcc/rust/ChangeLog:

* expand/rust-macro-builtins-asm.cc (parse_asm_arg): Emit error
message.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/expand/rust-macro-builtins-asm.cc

index 021cd734308d0a2e1a34cd41b2a9a8e5c0efda7d..96ff0ea849fd502dac2a33f3ccedd3819e390033 100644 (file)
@@ -671,6 +671,14 @@ parse_asm_arg (InlineAsmContext inline_asm_ctx)
     {
       token = parser.peek_current_token ();
 
+      if (token->get_id () == COLON || token->get_id () == SCOPE_RESOLUTION)
+       {
+         rust_error_at (
+           token->get_locus (),
+           "the legacy LLVM-style %<asm!%> syntax is no longer supported");
+         return tl::unexpected<InlineAsmParseError> (COMMITTED);
+       }
+
       // We accept a comma token here.
       if (token->get_id () != COMMA
          && inline_asm_ctx.consumed_comma_without_formatted_string)