With inline member functions that are defined outside the class, clang currently passes inlinehint attribute to optimizer if inline keyword is placed next to the declaration within the class body. In real world inline keyword is placed next to definition outside the class body because the public part of the class body is observable semantics and practically placing it next to definition makes it easier and safer for class's reusers. The decision of whether to inline or not to inline shouldn't change the observable semantics of the call.
Here is an example of an inline member function defined outside the class body:
class Foo { public: void method(); // Best practice: Don't put the inline keyword here // ... }; inline void Foo::method() // Best practice: Put the inline keyword here { // ... }
This patch fixes the above issue by passing inlinehint attribute if the function can be inherently inlined.