diff mbox series

[2/3] Parse close paren even when constexpr extraction fails

Message ID 20240612172031.3827584-2-ak@linux.intel.com
State New
Headers show
Series [1/3] Remove const char * support for asm constexpr | expand

Commit Message

Andi Kleen June 12, 2024, 5:20 p.m. UTC
To get better error recovery.

gcc/cp/ChangeLog:

	* parser.cc (cp_parser_asm_string_expression): Parse close
	parent when constexpr extraction fails.
---
 gcc/cp/parser.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc
index 98e8ca10ac40..adc4e6fc1aee 100644
--- a/gcc/cp/parser.cc
+++ b/gcc/cp/parser.cc
@@ -22856,7 +22856,7 @@  cp_parser_asm_string_expression (cp_parser *parser)
       if (!cstr.type_check (tok->location))
 	return error_mark_node;
       if (!cstr.extract (tok->location, string))
-	return error_mark_node;
+	string = error_mark_node;
       parens.require_close (parser);
       return string;
     }