The assert this patch deletes was valid only when aliasing D2 to D1, not when
looking at a base class. Since the assert was in the path where we had already
decided to not produce an alias, just drop it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194411
91177308-0d34-0410-b5e6-
96231b3b80d8
// Don't create an alias to a linker weak symbol unless we know we can do
// that in every TU. This avoids producing different COMDATs in different
// TUs.
- if (llvm::GlobalValue::isWeakForLinker(TargetLinkage)) {
- assert(Linkage == TargetLinkage);
+ if (llvm::GlobalValue::isWeakForLinker(TargetLinkage))
return true;
- }
}
// Create the alias with no name.
B X;
// CHECK-DAG: call i32 @__cxa_atexit({{.*}}@_ZN5test61AD2Ev
}
+
+namespace test7 {
+ // Test that we don't produce an alias from ~B to ~A<int> (or crash figuring
+ // out if we should).
+ // pr17875.
+ // CHECK-DAG: define void @_ZN5test71BD2Ev
+ template <typename> struct A {
+ ~A() {}
+ };
+ class B : A<int> {
+ ~B();
+ };
+ template class A<int>;
+ B::~B() {}
+}