diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2010-03-30 18:07:27 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2010-03-30 18:07:27 +0000 |
commit | ff6a1fc1f3e1d62b1d802ed03931409988b29817 (patch) | |
tree | b1630d6d0066f3ef120316214d228d610578ad94 /clang/test/CodeGenCXX/template-instantiation.cpp | |
parent | 67d94ab0f8dfb25a0d00dd4348b3c02ea284aee3 (diff) | |
download | bcm5719-llvm-ff6a1fc1f3e1d62b1d802ed03931409988b29817.tar.gz bcm5719-llvm-ff6a1fc1f3e1d62b1d802ed03931409988b29817.zip |
Don't produce a vtable if we are just instantiating a method and the
class has no key function.
Fix PR6738.
llvm-svn: 99900
Diffstat (limited to 'clang/test/CodeGenCXX/template-instantiation.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/template-instantiation.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/template-instantiation.cpp b/clang/test/CodeGenCXX/template-instantiation.cpp index 9e0593998bb..416c0a1a207 100644 --- a/clang/test/CodeGenCXX/template-instantiation.cpp +++ b/clang/test/CodeGenCXX/template-instantiation.cpp @@ -1,6 +1,7 @@ // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s // CHECK-NOT: @_ZTVN5test118stdio_sync_filebufIwEE = constant +// CHECK-NOT: _ZTVN5test315basic_fstreamXXIcEE // CHECK: @_ZTVN5test018stdio_sync_filebufIwEE = constant // CHECK: define linkonce_odr void @_ZN5test21CIiEC1Ev( @@ -60,3 +61,16 @@ namespace test2 { a.zedbar(0.0); } } + +namespace test3 { + template<typename T> + class basic_fstreamXX { + virtual void foo(){} + virtual void is_open() const { } + }; + + extern template class basic_fstreamXX<char>; + // This template instantiation should not cause us to produce a vtable. + // (test at the top). + template void basic_fstreamXX<char>::is_open() const; +} |