aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2022-02-25 15:26:17 -0400
committerJason Merrill <jason@redhat.com>2022-02-27 18:51:37 -0400
commit0096b0b467b2c98ed258f0ead9a8b87b2a6d8466 (patch)
treee5796704a0e4e99193398523fa68e6d96a4a559a /gcc/cp
parentd1574a9b820f17adb9004255e2018967e9be063b (diff)
downloadgcc-0096b0b467b2c98ed258f0ead9a8b87b2a6d8466.zip
gcc-0096b0b467b2c98ed258f0ead9a8b87b2a6d8466.tar.gz
gcc-0096b0b467b2c98ed258f0ead9a8b87b2a6d8466.tar.bz2
c++: (*(fn))() [PR104618]
The patch for PR90451 deferred marking to the point of actual use; we missed this one because of the parens. PR c++/104618 gcc/cp/ChangeLog: * typeck.cc (cp_build_addr_expr_1): Also maybe_undo_parenthesized_ref. gcc/testsuite/ChangeLog: * g++.dg/overload/paren1.C: New test.
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/typeck.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/cp/typeck.cc b/gcc/cp/typeck.cc
index f796337..bddc837 100644
--- a/gcc/cp/typeck.cc
+++ b/gcc/cp/typeck.cc
@@ -6884,9 +6884,9 @@ 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 (arg);
- if (TREE_CODE (stripped_arg) == FUNCTION_DECL
- && !mark_used (stripped_arg, complain) && !(complain & tf_error))
+ tree stripped_arg
+ = tree_strip_any_location_wrapper (maybe_undo_parenthesized_ref (arg));
+ if (!mark_single_function (stripped_arg, complain))
return error_mark_node;
val = build_address (arg);
if (TREE_CODE (arg) == OFFSET_REF)