https://gcc.gnu.org/g:56ccda1142cc2dc3a3e057d81d26d6a641732900

commit 56ccda1142cc2dc3a3e057d81d26d6a641732900
Author: Pierre-Emmanuel Patry <pierre-emmanuel.pa...@embecosm.com>
Date:   Wed Apr 9 17:41:24 2025 +0200

    Emit error with old asm syntax in new asm blocks
    
    gcc/rust/ChangeLog:
    
            * expand/rust-macro-builtins-asm.cc (parse_asm_arg): Emit error
            message.
    
    Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.pa...@embecosm.com>

Diff:
---
 gcc/rust/expand/rust-macro-builtins-asm.cc | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gcc/rust/expand/rust-macro-builtins-asm.cc 
b/gcc/rust/expand/rust-macro-builtins-asm.cc
index 021cd734308d..96ff0ea849fd 100644
--- a/gcc/rust/expand/rust-macro-builtins-asm.cc
+++ b/gcc/rust/expand/rust-macro-builtins-asm.cc
@@ -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)

Reply via email to