]> granicus.if.org Git - clang/commit
Avoid producing mismatched comdats.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 12 Nov 2013 22:06:46 +0000 (22:06 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 12 Nov 2013 22:06:46 +0000 (22:06 +0000)
commit610616c279681aa195cdf63b6472bc811e7d75a0
tree28adb2d780c4a9a3784ca5bf4f9a992983a3cd9d
parent186b26d01f2876e8b4b1f0f233e13fc4c613cddc
Avoid producing mismatched comdats.

The problem was that given

template<typename T>
struct foo {
  ~foo() {}
};
template class foo<int>;

We would produce a alias, creating a comdat with D0 and D1, since the symbols
have to be weak. Another TU is not required to have a explicit template
instantiation definition or an explict template instantiation declaration and
for

template<typename T>
struct foo {
  ~foo() {}
};
foo<int> a;

we would produce a comdat with only one symbol in it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194520 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGCXX.cpp
test/CodeGenCXX/ctor-dtor-alias.cpp