https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88335
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #46388|0 |1 is obsolete| | --- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 46390 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46390&action=edit gcc10-pr88335-wip.patch Updated patch. This one tries to evaluate immediate function calls immediately in build_over_call, adds some testsuite coverage etc. What still doesn't work is: 1) consteval constructors, I think evaluating those in build_over_call is too early, we need a TARGET_EXPR for them or something similar that supplies to the constexpr evaluation the object that is being initialized; so, where should we do that and should we do that that way only for ctors, or everything? 2) the example added to the end of [expr.const] doesn't work - we have in cxx_eval_outermost_constant_expr: if (VOID_TYPE_P (type)) return t; early exit. Is that something that is correct for anything? I mean, aren't we supposed to evaluate the constexpr (and consteval) functions anyway? constexpr void foo (bool x) { if (x) throw 1; } constexpr int a = (foo (false), 1); constexpr int b = (foo (true), 2); is handled correctly though, because in that case the void type expressions are the outermost ones. Perhaps we should do this early exit only if the expression isn't a call to an immediate function? 3) consteval virtual members not handled at all, and I'm afraid that is out of my area of expertise