aboutsummaryrefslogtreecommitdiff
path: root/test/SemaTemplate/extern-templates.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaTemplate/extern-templates.cpp')
-rw-r--r--test/SemaTemplate/extern-templates.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/test/SemaTemplate/extern-templates.cpp b/test/SemaTemplate/extern-templates.cpp
index 3a13d11c75..458957033e 100644
--- a/test/SemaTemplate/extern-templates.cpp
+++ b/test/SemaTemplate/extern-templates.cpp
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fsyntax-only %s
+// RUN: clang-cc -fsyntax-only -verify %s
template<typename T>
class X0 {
@@ -12,7 +12,7 @@ public:
template<typename T>
void X0<T>::f(T t) {
- t = 17;
+ t = 17; // expected-error{{incompatible}}
}
extern template class X0<int>;
@@ -21,10 +21,21 @@ extern template class X0<int*>;
template<typename T>
void X0<T>::Inner::g(T t) {
- t = 17;
+ t = 17; // expected-error{{incompatible}}
}
void test_intptr(X0<int*> xi, X0<int*>::Inner xii) {
xi.f(0);
xii.g(0);
}
+
+// FIXME: we would like the notes to point to the explicit instantiation at the
+// bottom.
+extern template class X0<long*>; // expected-note{{instantiation}}
+
+void test_longptr(X0<long*> xl, X0<long*>::Inner xli) {
+ xl.f(0);
+ xli.g(0); // expected-note{{instantiation}}
+}
+
+template class X0<long*>;