c++: improve failed constexpr assume diagnostic
I noticed that we were printing "the comparison reduces to (x == 42)" when
we should be able to give the value of x. Fixed by doing the same
evaluation in diagnose_failing_condition that we already do in
find_failing_clause.
gcc/cp/ChangeLog:
* constexpr.cc (fold_operand): New function.
(find_failing_clause_r): Add const.
(find_failing_clause): Add const.
(diagnose_failing_condition): Add ctx parameter.
(cxx_eval_internal_function): Pass it.
* semantics.cc (diagnose_failing_condition): Move to constexpr.cc.
* cp-tree.h: Adjust.
gcc/testsuite/ChangeLog:
* g++.dg/cpp23/attr-assume2.C: Expect constant values.