cross compilation unit inline?

I know this is not supported in traditional linker.
But is this supported after enabling LTO?
My experiment with Xcode 4.2 seems the answer is no, but I'd bring up to confirm.
Specifically, I mean the sample code below,

class A {
void foo ();
inline void A::foo() {
   // short code
#include "TestClass.h"
void main() {
    A a;;

The situation is C++ FAQ recommend putting inline in cpp file is best practice to hide implementation details, and MSVC can build the above code by enabling LTCG. Porting this codebase to LLVM+clang seems I have to either expose inline functions or remove inline keyword. I still need build the same codebase on MSVC, so that's not ideal.

Any comments are appreciated.



Seems like there's a little confusion here - the 'inline' keyword is
probably entirely ignored by MSVC there anyway. LTCG is probably just
making its own choice based on heuristics without the need for
developer guidance. LTO will do similarly, as far as I understand it.
Just drop the inline keyword & you should get reasonable behavior from
both compilers. If it changes MSVC's behavior I'll be surprised. If
Clang/LLVM's LTO doesn't make the right choices of inlining (within
reason - the heuristics used here can have subtle effects & it's not
necessarily going to be perfect in all cases) you could probably file
a bug or at least ask a question here.

- David