As discussed in
<https://gcc.gnu.org/pipermail/gcc-patches/2026-April/712156.html>,
this patch introduces a new predicate to be used instead of
really_overloaded_fn when we're checking for a function template in the
Reflection code.
gcc/cp/ChangeLog:
* cp-tree.h (reflection_function_template_p): Declare.
* parser.cc (cp_parser_splice_expression): Use
reflection_function_template_p instead of really_overloaded_fn.
* reflect.cc (check_splice_expr): Likewise.
(reflection_function_template_p): New.
Reviewed-by: Jason Merrill <jason@redhat.com>
extern bool dependent_splice_p (const_tree) ATTRIBUTE_PURE;
extern tree reflection_mangle_prefix (tree, char [3]);
extern void check_consteval_only_fn (tree);
+extern bool reflection_function_template_p (tree) ATTRIBUTE_PURE;
/* Inline bodies. */
&& (targs_p
/* No 'template' but the splice-specifier designates a function
template? */
- || really_overloaded_fn (t))
+ || reflection_function_template_p (t))
&& warning_enabled_at (loc, OPT_Wmissing_template_keyword))
/* Were 'template' present, this would be valid code, so keep going. */
missing_template_diag (loc, diagnostics::kind::pedwarn);
template. */
if (!targs_p)
{
- if (!really_overloaded_fn (t) && !dependent_splice_p (t))
+ if (!reflection_function_template_p (t) && !dependent_splice_p (t))
{
if (complain_p)
{
}
return false;
}
- gcc_checking_assert (really_overloaded_fn (t)
+ gcc_checking_assert (reflection_function_template_p (t)
|| get_template_info (t)
|| TREE_CODE (t) == TEMPLATE_ID_EXPR
|| variable_template_p (t)
gcc_unreachable ();
}
+/* Returns true iff X is a reflection of a function template. */
+
+bool
+reflection_function_template_p (tree x)
+{
+ return really_overloaded_fn (x);
+}
+
#include "gt-cp-reflect.h"