diff options
author | Jason Merrill <jason@redhat.com> | 2022-10-24 17:17:24 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2022-10-25 12:38:25 -0400 |
commit | ac8f92c18886057261d61d45b8d339629464c77e (patch) | |
tree | 0e7beb4f9c726f91550e35f0bf96d2015bf8be79 /gcc/expr.cc | |
parent | 4ba3902e8f1ee3ca35e3194053ebdc1e174808ea (diff) | |
download | gcc-ac8f92c18886057261d61d45b8d339629464c77e.zip gcc-ac8f92c18886057261d61d45b8d339629464c77e.tar.gz gcc-ac8f92c18886057261d61d45b8d339629464c77e.tar.bz2 |
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.
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions