From 8d88a9262fa0065d980f1c25893d6a4bae6be665 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 30 Mar 2016 06:27:31 +0000 Subject: For MS ABI, emit dllexport friend functions defined inline in class ...as that is apparently what MSVC does. This is an updated version of r263738, which had to be reverted in r263740 due to test failures. The original version had erroneously emitted functions that are defined in class templates, too (see the updated "Handle friend functions" code in EmitDeferredDecls, lib/CodeGen/ModuleBuilder.cpp). (The updated tests needed to be split out into their own dllexport-ms-friend.cpp because of the CHECK-NOTs which would have interfered with subsequent CHECK-DAGs in dllexport.cpp.) Differential Revision: http://reviews.llvm.org/D18430 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264841 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Parse/ParseCXXInlineMethods.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/Parse/ParseCXXInlineMethods.cpp') diff --git a/lib/Parse/ParseCXXInlineMethods.cpp b/lib/Parse/ParseCXXInlineMethods.cpp index 07e32b7e42..3db75c7ee7 100644 --- a/lib/Parse/ParseCXXInlineMethods.cpp +++ b/lib/Parse/ParseCXXInlineMethods.cpp @@ -564,8 +564,10 @@ void Parser::ParseLexedMethodDef(LexedMethod &LM) { if (Tok.is(tok::eof) && Tok.getEofData() == LM.D) ConsumeAnyToken(); - if (CXXMethodDecl *MD = dyn_cast_or_null(LM.D)) - Actions.ActOnFinishInlineMethodDef(MD); + if (auto *FD = dyn_cast_or_null(LM.D)) + if (isa(FD) || + FD->isInIdentifierNamespace(Decl::IDNS_OrdinaryFriend)) + Actions.ActOnFinishInlineFunctionDef(FD); } /// ParseLexedMemberInitializers - We finished parsing the member specification -- cgit v1.2.3