fix "unreplaced" warnings caused by using typeof() on inline functions

Currently, sparse do all its inlining at the tree level, during
constant expansion. To not mix-up the evaluation of the original
function body in case the address of an inline function is taken or
when the function can't otherwise be inlined, the statements and
symbols lists of inline functions are kept in separated fields.
Then, if the original body must be evaluated it must first be
'uninlined' to have a copy in the usual fields.

This make sense when dealing with the definition of the function.
But, when using typeof() on functions, the resulting type doesn't
refer to this definition, it's just a copy of the type and only
of the type. There shouldn't be any reasons to uninline anything.
However, the distinction between 'full function' and 'type only'
is not made during evaluation and the uninlining attempt produce
a lot of "warning: unreplaced symbol '...'" because of the lack
of a corresponding definition.

Fix this by not doing the uninlining if the symbol lack a definition.

Note: It would maybe be more appropriate for EXPR_TYPE to use
      a stripped-own version of evaluate_symbol() doing only the
      examination of the return and argument types, bypassing the
      attempt to uninline the body and evaluate the initializer and
      the statements since there is none of those for an EXPR_TYPE.

Reported-by: kernel test robot <>
Signed-off-by: Luc Van Oostenryck <>
3 files changed