From 6b4b8ef2b2fc24389224d34e6b0c5265d5c2eb6c Mon Sep 17 00:00:00 2001 From: Richard Smith <richard-llvm@metafoo.co.uk> Date: Wed, 1 Jul 2015 07:24:18 +0000 Subject: [PATCH] [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 --- lib/Sema/SemaDecl.cpp | 2 +- test/Modules/Inputs/submodules-merge-defs/defs.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 1dec6fc1092..6508d6f04bb 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 247b05c4708..8b6fec60fcf 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<typename, int, template<typename> class> friend struct D; }; } + +namespace SeparateInline { + inline void f(); + void f() {} + constexpr int g() { return 0; } +} -- GitLab