It is not the compiler's job to tell the programmer what to do.
There's no better way to say it. They should print these words on T-shirts and mugs.
I hate abstractions, things that do something beyond my knowledge and control. Currently, as you probably know, I'm working on an engine for my future game. I write all the code, both for the engine and the game itself, as low-level as possible — procedural-structural paradigm, manual memory management, pointers everywhere. I want to know everything about how the code works and control every aspect of it. I have a lot of small functions marked as inline, so I need to know which ones are and which are not ultimately inlined.
The compiler generates notes in case a given function cannot be inlined, but for some reason I had these notes hidden in the project settings. After enabling this particular message, the
Note: Call to subroutine "$1" marked as inline not inlined notes are normally visible in the message window, with default filtering (filter hints and below). So here is my fault.
However, this still does not change the fact that there is no way to force the compiler to inline, so the proposal is still valid.
No, because the decision to inline not only depends on the routine that is marked as inline, but also on the routine that is calling the routine (and thus would receive the inlined body). If the node count becomes to complex (e.g. due to multiple inlinings) then the compiler will not inline it. Enforcing inlining goes against this.
And that's why the compiler should throw a compilation error that inlining is not technically possible. That's what I mean, this is what my proposal is about. In short, regular
inline tells the compiler to inline but lets it decide whether to do so, whereas
forceinline commands the compiler to inline and if it can't do so, compilation aborts and a error is emitted.
$AutoInline is as if all routines are marked with inline (at least if they are technically inlinable anyway) though the compiler won't warn if it can't inline them anyway.
Ok, thank you for explanation, now everything is clear to me.