]> granicus.if.org Git - clang/commitdiff
[modules] Don't require the 'inline' specifier when merging an inline function;
authorRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 1 Jul 2015 07:24:18 +0000 (07:24 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 1 Jul 2015 07:24:18 +0000 (07:24 +0000)
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
test/Modules/Inputs/submodules-merge-defs/defs.h

index 1dec6fc10928ae901873038ad1d9807183da826f..6508d6f04bb26486ef7f4ffab84a730cb16bd59c 100644 (file)
@@ -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;
index 247b05c47082c757e9fe0d3cbaf6ca5bdcf51510..8b6fec60fcf74087ffcd29daf510fe0b7b6a6f2f 100644 (file)
@@ -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; }
+}