Index: lib/CodeGen/CodeGenFunction.cpp =================================================================== --- lib/CodeGen/CodeGenFunction.cpp +++ lib/CodeGen/CodeGenFunction.cpp @@ -595,7 +595,7 @@ if (const FunctionDecl *FD = dyn_cast_or_null(D)) { if (!CGM.getCodeGenOpts().NoInline) { for (auto RI : FD->redecls()) - if (RI->isInlineSpecified()) { + if (RI->isInlined()) { Fn->addFnAttr(llvm::Attribute::InlineHint); break; } Index: test/CodeGen/inlinehintattr.cpp =================================================================== --- /dev/null +++ test/CodeGen/inlinehintattr.cpp @@ -0,0 +1,30 @@ +// RUN: %clang_cc1 %s -disable-llvm-optzns -emit-llvm -o- | FileCheck %s --check-prefix=INLINE +// INLINE-LABEL: Function Attrs: inlinehint +// INLINE-LABEL-NEXT: @_ZN3fooIiE3addEv + +template class foo { + public: + T* tp; + int elem; + int maxelem; + T* add(); +}; + +template inline T* foo ::add() +{ + if (elem!=maxelem) + elem++; + return tp+elem-1; +} + +typedef foo intboundart; + +class bar +{ + void addtobound(intboundart& boundarp); +}; + +void bar::addtobound(intboundart& barp) +{ + barp.add(); +}