aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.cc
diff options
context:
space:
mode:
authorAndi Kleen <ak@gcc.gnu.org>2024-07-20 16:07:41 -0700
committerAndi Kleen <ak@gcc.gnu.org>2024-07-20 16:07:41 -0700
commitff6994e483be5bd340bfacc50d3441bd21aba1c4 (patch)
treea1915366e279218a7b95be41d19c8bf2830465a6 /gcc/cp/parser.cc
parent493c55578fe00f5f4a7534b8f5cb5213f86f4d01 (diff)
downloadgcc-ff6994e483be5bd340bfacc50d3441bd21aba1c4.zip
gcc-ff6994e483be5bd340bfacc50d3441bd21aba1c4.tar.gz
gcc-ff6994e483be5bd340bfacc50d3441bd21aba1c4.tar.bz2
Revert "C++: Support clang compatible [[musttail]] (PR83324)"
This reverts commit 59dd1d7ab21ad9a7ebf641ec9aeea609c003ad2f.
Diffstat (limited to 'gcc/cp/parser.cc')
-rw-r--r--gcc/cp/parser.cc32
1 files changed, 3 insertions, 29 deletions
diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc
index 1fa0780..efd5d6f 100644
--- a/gcc/cp/parser.cc
+++ b/gcc/cp/parser.cc
@@ -2467,7 +2467,7 @@ static tree cp_parser_perform_range_for_lookup
static tree cp_parser_range_for_member_function
(tree, tree);
static tree cp_parser_jump_statement
- (cp_parser *, tree &);
+ (cp_parser *);
static void cp_parser_declaration_statement
(cp_parser *);
@@ -12757,7 +12757,7 @@ cp_parser_statement (cp_parser* parser, tree in_statement_expr,
case RID_CO_RETURN:
case RID_GOTO:
std_attrs = process_stmt_hotness_attribute (std_attrs, attrs_loc);
- statement = cp_parser_jump_statement (parser, std_attrs);
+ statement = cp_parser_jump_statement (parser);
break;
/* Objective-C++ exception-handling constructs. */
@@ -14845,11 +14845,10 @@ cp_parser_init_statement (cp_parser *parser, tree *decl)
jump-statement:
goto * expression ;
- STD_ATTRS are the statement attributes. They can be modified.
Returns the new BREAK_STMT, CONTINUE_STMT, RETURN_EXPR, or GOTO_EXPR. */
static tree
-cp_parser_jump_statement (cp_parser* parser, tree &std_attrs)
+cp_parser_jump_statement (cp_parser* parser)
{
tree statement = error_mark_node;
cp_token *token;
@@ -14926,31 +14925,6 @@ cp_parser_jump_statement (cp_parser* parser, tree &std_attrs)
/* If the next token is a `;', then there is no
expression. */
expr = NULL_TREE;
-
- if (keyword == RID_RETURN)
- {
- bool musttail_p = false;
- if (lookup_attribute ("gnu", "musttail", std_attrs))
- {
- musttail_p = true;
- std_attrs = remove_attribute ("gnu", "musttail", std_attrs);
- }
- /* Support this for compatibility. */
- if (lookup_attribute ("clang", "musttail", std_attrs))
- {
- musttail_p = true;
- std_attrs = remove_attribute ("clang", "musttail", std_attrs);
- }
-
- tree ret_expr = expr;
- if (ret_expr && TREE_CODE (ret_expr) == TARGET_EXPR)
- ret_expr = TARGET_EXPR_INITIAL (ret_expr);
- if (ret_expr && TREE_CODE (ret_expr) == AGGR_INIT_EXPR)
- AGGR_INIT_EXPR_MUST_TAIL (ret_expr) = musttail_p;
- else
- set_musttail_on_return (expr, token->location, musttail_p);
- }
-
/* Build the return-statement, check co-return first, since type
deduction is not valid there. */
if (keyword == RID_CO_RETURN)