If you have function call with constants, it has no side effects and it is not dependent on anything, like the following:
int foo(int a,int b)
{
return a+b;
}
Does the function get inlined? Or, perhaps is the function evaluated at compile-time, with the result of this evaluation inserted in place of the function call?
I tried compiling this using a fairly old gcc –
And main compiled to this –
So it compiled the addition at compile time getting 223.
Obviously the results depend on your code and compiler but this shows that it can and does both inline and compute the addition at compile time if it can.