r241146 - [modules] Don't require the 'inline' specifier when merging an inline function;

Richard Smith richard-llvm at metafoo.co.uk
Wed Jul 1 00:24:19 PDT 2015


Author: rsmith
Date: Wed Jul  1 02:24:18 2015
New Revision: 241146

URL: http://llvm.org/viewvc/llvm-project?rev=241146&view=rev
Log:
[modules] Don't require the 'inline' specifier when merging an inline function;
any source of the inline nature is sufficient.

Modified:
    cfe/trunk/lib/Sema/SemaDecl.cpp
    cfe/trunk/test/Modules/Inputs/submodules-merge-defs/defs.h

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=241146&r1=241145&r2=241146&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Wed Jul  1 02:24:18 2015
@@ -10385,7 +10385,7 @@ Sema::CheckForFunctionRedefinition(Funct
   // 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;

Modified: cfe/trunk/test/Modules/Inputs/submodules-merge-defs/defs.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/submodules-merge-defs/defs.h?rev=241146&r1=241145&r2=241146&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/submodules-merge-defs/defs.h (original)
+++ cfe/trunk/test/Modules/Inputs/submodules-merge-defs/defs.h Wed Jul  1 02:24:18 2015
@@ -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; }
+}





More information about the cfe-commits mailing list