pragma(inline, true) errors?

Steven Schveighoffer schveiguy at gmail.com
Fri Apr 2 14:40:00 UTC 2021


Nobody has comments on this? It was not an April fool's joke.

To recap:

pragma(inline, true)

means nothing in the current compiler. Well, it doesn't mean nothing, it 
only means that in the case of configuring the compiler to treat 
warnings as informational-only, you will get an informational warning. 
In the case that warnings are treated as an error, your code always 
compiles, and the function is only inlined based on implementation 
definitions.

Technically, this is according to spec, as it says what the compiler 
does if a pragma(inline, true) function cannot be inlined is 
implementation defined. But it does say "an error message is typical". 
Given that there is only one front end, the typical (and in fact 
universal) behavior now is, do nothing.

-Steve


More information about the Digitalmars-d mailing list