Compare canonical return types when generating MS C++ ABI vtable thunks
This was part of the cause for PR17655. We were generating thunks when
we shouldn't have. I suspect that if we tweak the test case for PR17655
to actually require thunks, we can reproduce the same crash.
llvm-svn: 197836
diff --git a/clang/lib/AST/VTableBuilder.cpp b/clang/lib/AST/VTableBuilder.cpp
index 5f7ae0f..63ac6f2 100644
--- a/clang/lib/AST/VTableBuilder.cpp
+++ b/clang/lib/AST/VTableBuilder.cpp
@@ -2888,7 +2888,8 @@
AddThunk(MD, VTableThunks[OverriddenMethodInfo.VFTableIndex]);
}
- if (MD->getResultType() == OverriddenMD->getResultType()) {
+ if (Context.hasSameType(MD->getResultType(),
+ OverriddenMD->getResultType())) {
// No return adjustment needed - just replace the overridden method info
// with the current info.
MethodInfo MI(OverriddenMethodInfo.VBTableIndex,