Stream: t-compiler/const-eval

Topic: `ident` function in CTFE tests?

RalfJ (Jun 08 2019 at 10:04, on Zulip):

What is the point of the ident function in tests like ?
We sometimes have this to avoid promotion of the argument, but here the argument is a constant so there is nothing to compute anyway... so why would we even care?

oli (Jun 08 2019 at 10:08, on Zulip):

it's not just promotion, but also const propagation. If we const propagate enough, then even the comparison may get optimized out at some point. In the case you linked I think it's just coming from the other tests that actually compute something.

RalfJ (Jun 08 2019 at 10:19, on Zulip):

most of these const-int tests don't compute anything

RalfJ (Jun 08 2019 at 10:19, on Zulip):

and const propagation will not stop just because something is the argument to a function.

RalfJ (Jun 08 2019 at 10:20, on Zulip):

so you agree I can remove ident for cases where nothing gets computed?

oli (Jun 08 2019 at 10:23, on Zulip):


RalfJ (Jun 08 2019 at 10:25, on Zulip):

oh, also -- shouldn't that test be in the consts directory?

oli (Jun 08 2019 at 10:26, on Zulip):

if run-pass has such a folder

oli (Jun 08 2019 at 10:26, on Zulip):

I think there's a ctfe folder?

RalfJ (Jun 08 2019 at 10:28, on Zulip):

there's ctfe and consts...

oli (Jun 08 2019 at 10:29, on Zulip):

we are very consistent with naming things

RalfJ (Jun 08 2019 at 10:31, on Zulip):


Last update: Jan 19 2020 at 10:15UTC