GH-40395: [C++] Avoid simplifying expressions which call impure functions
Rationale for this change
Fix a problem when we call SimplifyWithGuarantee evaluate a function call which has no arguments.
What changes are included in this PR?
Check empty for call.arguments before we evaluate arguments as literal in FoldConstants.
Are these changes tested?
Yes.
Are there any user-facing changes?
No.
- GitHub Issue: #40395
:x: GitHub issue #40935 could not be retrieved.
:x: GitHub issue #40935 could not be retrieved.
:warning: GitHub issue #40395 has been automatically assigned in GitHub to PR creator.
cc @bkietz PTAL?
After merging your PR, Conbench analyzed the 7 benchmarking runs that have been run so far on merge-commit d10f468b0603da41a285c60a38b095a30b91e2c1.
There were no benchmark performance regressions. 🎉
The full Conbench report has more details. It also includes information about 4 possible false positives for unstable benchmarks that are known to sometimes produce them.