https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88335
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 46388 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46388&action=edit gcc10-pr88335.patch Untested WIP patch. Need to decide now from where exactly to call the immediate functions when not in immediate function contexts, shall that be done say from build_call_a/build_over_call once the expression is built and if nothing in the expression is dependent, or shall it be done say only from cp_fold? The latter seems better conceptually (that we don't fold stuff too early), but might need to handle it also in various unevaluated codepaths. Also, I guess if during !ctx->manifestly_const_eval constexpr evaluation we encounter immediate function call, we need to evaluate the call separately in a manifestly_const_eval mode and only then return back to the normal constexpr evaluation. Some work will need to be done to make sure we don't hand over immediate functions to the middle-end, another question is what to do about virtual immediate functions, for the constexpr evaluations we want to see them in whatever data structures we have for virtual tables, but what we later hand over to the middle-end and emit should not include those, what shall we do with classes that don't have any virtual members other than immediate functions, etc.