aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.cc
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2024-06-12 09:09:37 -0700
committerAndi Kleen <ak@linux.intel.com>2024-06-12 22:08:08 -0700
commit6f1f1657cd7a8472b4a4aeef60f1c59606ee011b (patch)
treefdf22713fbeeb14abdf0bc759ecfe1b346e8f867 /gcc/cp/parser.cc
parentf8bf80a4e1682b2238baad8c44939682f96b1fe0 (diff)
downloadgcc-6f1f1657cd7a8472b4a4aeef60f1c59606ee011b.zip
gcc-6f1f1657cd7a8472b4a4aeef60f1c59606ee011b.tar.gz
gcc-6f1f1657cd7a8472b4a4aeef60f1c59606ee011b.tar.bz2
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.
Diffstat (limited to 'gcc/cp/parser.cc')
-rw-r--r--gcc/cp/parser.cc7
1 files changed, 0 insertions, 7 deletions
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;