On Sat, Sep 21, 2024 at 05:00:51PM +0200, Jakub Jelinek wrote:
> On Fri, Sep 20, 2024 at 07:03:45PM -0400, Jason Merrill wrote:
> > > The CALL_EXPR case in cp_fold uses !flag_no_inline instead, that makes 
> > > more
> > > sense to me.
> > > Because checking "noinline" attribute (which means don't inline this
> > > function) on current_function_decl rather than on functions being 
> > > "inlined"
> > > (the constexpr functions being non-manifestly constant evaluated) is just
> > > weird.
> > > If we really wanted, we could honor "noinline" during constant evaluation
> > > on the CALL_EXPR/AGGR_INIT_EXPR fndecls, but dunno if whenever doing the
> > > non-manifestly constant evaluated cases or just in special cases like 
> > > these
> > > two (CALL_EXPR in cp_fold, this in cp_fold_r).
> > 
> > Checking noinline in non-manifestly constant-evaluated cases might make
> > sense.
> 
> Though, if somebody marks some function explicitly constexpr they should be
> prepared to get some constexpr evaluation of it, doesn't have to be strictly
> standard required one.

Yeah, I would agree with that.

> And for -fimplicit-constexpr we already have "noinline" attribute check, so
> maybe it is ok as is.

Yeah.  I dropped the "noinline" attribute check though because I no longer
see any need for it.

Marek

Reply via email to