From: Richard Smith Date: Wed, 1 Jul 2015 07:24:18 +0000 (+0000) Subject: [modules] Don't require the 'inline' specifier when merging an inline function; X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6b4b8ef2b2fc24389224d34e6b0c5265d5c2eb6c;p=clang [modules] Don't require the 'inline' specifier when merging an inline function; any source of the inline nature is sufficient. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241146 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 1dec6fc109..6508d6f04b 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -10385,7 +10385,7 @@ Sema::CheckForFunctionRedefinition(FunctionDecl *FD, // through a deduced return type, or instantiate templates with local types. if (!hasVisibleDefinition(Definition) && (Definition->getFormalLinkage() == InternalLinkage || - Definition->isInlineSpecified() || + Definition->isInlined() || Definition->getDescribedFunctionTemplate() || Definition->getNumTemplateParameterLists())) return; diff --git a/test/Modules/Inputs/submodules-merge-defs/defs.h b/test/Modules/Inputs/submodules-merge-defs/defs.h index 247b05c470..8b6fec60fc 100644 --- a/test/Modules/Inputs/submodules-merge-defs/defs.h +++ b/test/Modules/Inputs/submodules-merge-defs/defs.h @@ -74,3 +74,9 @@ namespace FriendDefArg { template class> friend struct D; }; } + +namespace SeparateInline { + inline void f(); + void f() {} + constexpr int g() { return 0; } +}