>From what I know, the flatten attribute pretty much tells gcc "Forget heuristics, inline everything into this method" and is basically you telling the compiler that you know better than it in this case. It (And always_inline) wouldn't be very useful if they didn't do what you requested of the compiler based on its mood. But the bigger problem according to some chats with the gcc developers is that the flatten attribute simply just wasn't made with LTO in mind and so doesn't check if a method is defined in another source file before inlining it. Short of something like adding a parameter to the flatten attribute to disable cross compilation unit inlining within gcc itself (Or something along those lines), there's nothing much one can do aside from use noinline as appropriate to stop the inlining madness from happening, unfortunately.
best regards, Julian
