From 6f1f1657cd7a8472b4a4aeef60f1c59606ee011b Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Wed, 12 Jun 2024 09:09:37 -0700 Subject: Remove const char * support for asm constexpr asm constexpr now only accepts the same string types as C++26 assert, e.g. string_view and string. Adjust test suite and documentation. gcc/cp/ChangeLog: * parser.cc (cp_parser_asm_string_expression): Remove support for const char * for asm constexpr. gcc/ChangeLog: * doc/extend.texi: Use std::string_view in asm constexpr example. gcc/testsuite/ChangeLog: * g++.dg/cpp1z/constexpr-asm-1.C: Use std::std_string_view. * g++.dg/cpp1z/constexpr-asm-3.C: Dito. --- gcc/cp/parser.cc | 7 ------- 1 file changed, 7 deletions(-) (limited to 'gcc/cp/parser.cc') diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc index de5f048..98e8ca1 100644 --- a/gcc/cp/parser.cc +++ b/gcc/cp/parser.cc @@ -22852,13 +22852,6 @@ cp_parser_asm_string_expression (cp_parser *parser) tree string = cp_parser_constant_expression (parser); if (string != error_mark_node) string = cxx_constant_value (string, tf_error); - if (TREE_CODE (string) == NOP_EXPR) - string = TREE_OPERAND (string, 0); - if (TREE_CODE (string) == ADDR_EXPR - && TREE_CODE (TREE_OPERAND (string, 0)) == STRING_CST) - string = TREE_OPERAND (string, 0); - if (TREE_CODE (string) == VIEW_CONVERT_EXPR) - string = TREE_OPERAND (string, 0); cexpr_str cstr (string); if (!cstr.type_check (tok->location)) return error_mark_node; -- cgit v1.1