On Tue, Jun 25, 2019 at 1:20 AM Sven Barth via fpc-devel < fpc-devel@lists.freepascal.org> wrote:
> Correct. Though considering that we're talking about *compile time* the > compiler *could* treat consts (in {$J-} mode) as constants if pure > functions are involved... > I'd be fine with the {$J-} requirement (I tend to use {$J-} most of the time anyways, actually.) Again, I'm aware all of this will take a while to implement, and will be an incremental process. Overall though I think proper compile-time constant initialization needs to be something `pure` eventually enables, as if it doesn't then it just becomes "slightly-different-inlining". (And like denisgolovan pointed out in another message, inlining should remain a separate concept that can be mixed with pure, or not mixed with it, depending on the use case. E.G. a C++ compiler will automatically inline basically anything at -O3, but it will not let you use a non-constexpr function to initialize an actual constexpr value.)
_______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel