]> granicus.if.org Git - clang/commit
[MS] Defer dllexport inline friend functions like other inline methods
authorReid Kleckner <rnk@google.com>
Tue, 18 Sep 2018 23:16:30 +0000 (23:16 +0000)
committerReid Kleckner <rnk@google.com>
Tue, 18 Sep 2018 23:16:30 +0000 (23:16 +0000)
commitc8df8c22bd6f649763c20fb4b8a944309008da6a
tree8456bf4cfe69fa42167344727603597d0db58118
parent6f42893d1084a87059e7fca623dfddad0860080a
[MS] Defer dllexport inline friend functions like other inline methods

This special case was added in r264841, but the code breaks our
invariants by calling EmitTopLevelDecl without first creating a
HandlingTopLevelDeclRAII scope.

This fixes the PCH crash in https://crbug.com/884427. I was never able
to make a satisfactory reduction, unfortunately. I'm not very worried
about this regressing since this change makes the code simpler while
passing the existing test that shows we do emit dllexported friend
function definitions. Now we just defer their emission until the tag is
fully complete, which is generally good.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342516 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/ModuleBuilder.cpp