There is a pretty good overview of gcc's inlining options and the decision processes at GNU GCC.
That identifies the cases where inlining is not possible: "use of varargs, use of alloca, use of variable sized data types, use of computed goto, use of nonlocal goto, and nested functions"
An important point is a non-static function, i.e one with extern linkage (which is every functions which is declared without static) may be called, or have its address taken in a different source file.
This forces the compiler to generate a 'normal' function as well as any inlined function bodies. This, of course, generates a program which is bigger than only generating the 'normal' non-inline function.
Gcc has an option -ffunction-sections which generate object files which enable the linker to eliminate functions which are not used, at the cost of "... the assembler and linker will create larger object and executable files and will also be slower."
On more recent versions of gcc, Link Time Optimisations (LTO) (see "Whole Program Optimizations") is supported. This allows an optimisation stage to look at all the compiled program, and do even more aggressive inlining and optimisation, and exclude unused code.
It is also interesting to look at some of the newer gcc-4.6 gcc-4.7 Interprocedural optimisations. For example inline-ing only the 'hot path' of an inline function, rather than the whole function. Gcc might also generate multiple instances of one function because constants are known, and gcc calculates it is better to have multiple implementations, each optimised for those known constants.
There are options in gcc to ask for the compiler to inline all “simple enough” functions.
Finally it says "As required by ISO C++, GCC considers member functions defined within the body of a class to be marked inline even if they are not explicitly declared with the inline keyword". In which case its rule for "simple enough" is used.
Summary: the compiler might do very clever optimisations above and beyond what might be expected from ordinary functions or inline functions.
inlinemarked function that it will not create linker conflicts when its definition occurs in several compilation units. So you can safely put it in a header file. In that senseinlinemakes it possible that a function is inlined in several units.