diff options
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/PCH/cxx-templates.cpp | 3 | ||||
| -rw-r--r-- | clang/test/PCH/cxx-templates.h | 11 |
2 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/PCH/cxx-templates.cpp b/clang/test/PCH/cxx-templates.cpp index 8e89b1da462..0749fc31e39 100644 --- a/clang/test/PCH/cxx-templates.cpp +++ b/clang/test/PCH/cxx-templates.cpp @@ -7,6 +7,7 @@ // RUN: %clang_cc1 -include-pch %t -verify %s -ast-dump 1>/dev/null // RUN: %clang_cc1 -include-pch %t %s -emit-llvm -o - | FileCheck %s +// CHECK: define weak_odr void @_ZN2S4IiE1mEv // CHECK: define linkonce_odr void @_ZN2S3IiE1mEv struct A { @@ -30,3 +31,5 @@ void test() { S3<int> s3; s3.m(); } + +template struct S4<int>; diff --git a/clang/test/PCH/cxx-templates.h b/clang/test/PCH/cxx-templates.h index 91d53d3060a..978d768acc9 100644 --- a/clang/test/PCH/cxx-templates.h +++ b/clang/test/PCH/cxx-templates.h @@ -124,3 +124,14 @@ struct S3 { template <typename T> inline void S3<T>::m() { } + +template <typename T> +struct S4 { + void m() { } +}; +extern template struct S4<int>; + +void S4ImplicitInst() { + S4<int> s; + s.m(); +} |

