OK for trunk?
-- >8 --
While looking at a different crash I noticed this comment
is obsolete (we no longer have build_non_dependent_expr), so update it.
The ctx->quiet assert is exercised in consteval-memfn1.C. Note that
there we are called from cp_get_fndecl_from_callee and we have
a COMPONENT_REF whose second operand is a BASELINK, but that BASELINK
names only one function. So perhaps we should be able to pull that
one function out.
gcc/cp/ChangeLog:
* constexpr.cc (cxx_eval_constant_expression)
<case COMPONENT_REF>: Update comment.
---
gcc/cp/constexpr.cc | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/gcc/cp/constexpr.cc b/gcc/cp/constexpr.cc
index 31ef5bf1111..c891cc10671 100644
--- a/gcc/cp/constexpr.cc
+++ b/gcc/cp/constexpr.cc
@@ -10614,10 +10614,9 @@ cxx_eval_constant_expression (const constexpr_ctx
*ctx, tree t,
case COMPONENT_REF:
if (is_overloaded_fn (t))
{
- /* We can only get here in checking mode via
- build_non_dependent_expr, because any expression that
- calls or takes the address of the function will have
- pulled a FUNCTION_DECL out of the COMPONENT_REF. */
+ /* We can get here in a template on a non-dependent call via e.g.
+ cp_get_fndecl_from_callee, where the callee is a COMPONENT_REF
+ of a BASELINK. */
gcc_checking_assert (ctx->quiet || errorcount);
*non_constant_p = true;
return t;
base-commit: d9f9f65b4272a3f7f487dc6ef8713522bd2536a8
--
2.56.0