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.
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))
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)