diff options
author | Jason Merrill <jason@redhat.com> | 2022-02-28 12:05:34 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2022-03-07 18:32:39 -0500 |
commit | 03e0c807ef50684cc1d49144948aa409decb91f9 (patch) | |
tree | 81484a22271c27b98e604b568b05cb1aa7329db5 | |
parent | b7dbe870bc0193c76345f893d94c5bf6c99a6afe (diff) | |
download | gcc-03e0c807ef50684cc1d49144948aa409decb91f9.zip gcc-03e0c807ef50684cc1d49144948aa409decb91f9.tar.gz gcc-03e0c807ef50684cc1d49144948aa409decb91f9.tar.bz2 |
c++: tweak to (*(fn))() patch [PR104618]
Other callers of mark_single_function might also want to look through these
wrapapers.
PR c++/104618
gcc/cp/ChangeLog:
* decl2.cc (mark_single_function): Look through parens and location
wrapper.
* typeck.cc (cp_build_addr_expr_1): Not here.
-rw-r--r-- | gcc/cp/decl2.cc | 3 | ||||
-rw-r--r-- | gcc/cp/typeck.cc | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/gcc/cp/decl2.cc b/gcc/cp/decl2.cc index 22edc2b..e85bb87 100644 --- a/gcc/cp/decl2.cc +++ b/gcc/cp/decl2.cc @@ -5737,6 +5737,9 @@ decl_dependent_p (tree decl) bool mark_single_function (tree expr, tsubst_flags_t complain) { + expr = maybe_undo_parenthesized_ref (expr); + expr = tree_strip_any_location_wrapper (expr); + if (is_overloaded_fn (expr) == 1 && !mark_used (expr, complain) && (complain & tf_error)) diff --git a/gcc/cp/typeck.cc b/gcc/cp/typeck.cc index bddc837..ea6a485 100644 --- a/gcc/cp/typeck.cc +++ b/gcc/cp/typeck.cc @@ -6884,9 +6884,7 @@ cp_build_addr_expr_1 (tree arg, bool strict_lvalue, tsubst_flags_t complain) so we can just form an ADDR_EXPR with the correct type. */ if (processing_template_decl || TREE_CODE (arg) != COMPONENT_REF) { - tree stripped_arg - = tree_strip_any_location_wrapper (maybe_undo_parenthesized_ref (arg)); - if (!mark_single_function (stripped_arg, complain)) + if (!mark_single_function (arg, complain)) return error_mark_node; val = build_address (arg); if (TREE_CODE (arg) == OFFSET_REF) |