diff options
Diffstat (limited to 'lib/CodeGen/CGVTables.cpp')
-rw-r--r-- | lib/CodeGen/CGVTables.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/CodeGen/CGVTables.cpp b/lib/CodeGen/CGVTables.cpp index 3dd7a15fe3..d74226ec89 100644 --- a/lib/CodeGen/CGVTables.cpp +++ b/lib/CodeGen/CGVTables.cpp @@ -2723,8 +2723,13 @@ void CodeGenVTables::EmitThunk(GlobalDecl GD, const ThunkInfo &Thunk, return; } - // We should never be able to get a function with a definition here. - assert(false && "Shouldn't have an already existing definition"); + // If a function has a body, it should have available_externally linkage. + assert(ThunkFn->hasAvailableExternallyLinkage() && + "Function should have available_externally linkage!"); + + // Change the linkage. + CGM.setFunctionLinkage(cast<CXXMethodDecl>(GD.getDecl()), ThunkFn); + return; } // Actually generate the thunk body. |