diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-05-06 23:13:35 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-05-06 23:13:35 +0000 |
commit | d8bb3aff76145e391a0df4be7591021d083bc258 (patch) | |
tree | 7fc79f3ac05176d6d7c5f821c89123254ebba38a /clang/test/CodeGenCXX/template-linkage.cpp | |
parent | 21aa523c280f1af701bff57f42f9c44094a1ff60 (diff) | |
download | bcm5719-llvm-d8bb3aff76145e391a0df4be7591021d083bc258.tar.gz bcm5719-llvm-d8bb3aff76145e391a0df4be7591021d083bc258.zip |
Do not give implicitly-defined virtual members functions
available_externally linkage, since they may not have been given a
strong definition in another translation unit. Without this patch, the
following test case fails to link with a GCC-compiled libstdc++:
#include <sstream>
int main() { std::basic_stringbuf<char> bs; }
Fixes the last problem with the Boost.IO library.
llvm-svn: 103208
Diffstat (limited to 'clang/test/CodeGenCXX/template-linkage.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/template-linkage.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/template-linkage.cpp b/clang/test/CodeGenCXX/template-linkage.cpp index ccd61a7bbe3..63a5c09cd7d 100644 --- a/clang/test/CodeGenCXX/template-linkage.cpp +++ b/clang/test/CodeGenCXX/template-linkage.cpp @@ -22,3 +22,23 @@ template void f<int>(int); template <typename T> inline void g(T) { } template void g<int>(int); +template<typename T> +struct X0 { + virtual ~X0() { } +}; + +template<typename T> +struct X1 : X0<T> { + virtual void blarg(); +}; + +template<typename T> void X1<T>::blarg() { } + +extern template struct X0<char>; +extern template struct X1<char>; + +// CHECK: define linkonce_odr void @_ZN2X1IcED1Ev( +void test_X1() { + X1<char> i1c; +} + |