This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] Implement P1073R3: Immediate functions (PR c++/88335)
- From: Jason Merrill <jason at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 22 Oct 2019 09:55:06 -0400
- Subject: Re: [C++ PATCH] Implement P1073R3: Immediate functions (PR c++/88335)
- References: <20191015170442.GH2116@tucnak> <f1871c92-b72b-d3b0-ddde-4c13d1f52464@redhat.com>
On Mon, Oct 21, 2019 at 1:59 PM Jason Merrill <jason@redhat.com> wrote:
> On 10/15/19 1:04 PM, Jakub Jelinek wrote:
> > Unlike the previous implementation, this doesn't invoke consteval function
> > already during parsing, but later on, so there aren't issues with say
> > consteval constructors or consteval in default arguments.
>
> Right, we can't immediately evaluate a class prvalue before we know what
> object it's initializing.
Actually, I'm not sure about this. There's no way to consistently
know what object is being initialized soon enough for the evaluation
to be immediate, so I think we need to always create a temporary for
immediate invocations of class type, so we could go ahead and do
immediate evaluation in build_cxx_call. I think this also follows
from an immediate invocation being a full-expression.
Jason