summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP
diff options
context:
space:
mode:
authorSerge Pavlov <sepavloff@gmail.com>2016-04-19 06:19:52 +0000
committerSerge Pavlov <sepavloff@gmail.com>2016-04-19 06:19:52 +0000
commit7dcc97e7ac0a7184f527c77178ecc9db7b412dc8 (patch)
tree25b03f63bb0010920c7624e5ec6478f67b2d953f /clang/test/OpenMP
parent77fa84eadd926bd95b9893c9fba949eb01bd50be (diff)
downloadbcm5719-llvm-7dcc97e7ac0a7184f527c77178ecc9db7b412dc8.tar.gz
bcm5719-llvm-7dcc97e7ac0a7184f527c77178ecc9db7b412dc8.zip
Warn if function or variable cannot be implicitly instantiated
With this patch compiler emits warning if it tries to make implicit instantiation of a template but cannot find the template definition. The warning can be suppressed by explicit instantiation declaration or by command line options -Wundefined-var-template and -Wundefined-func-template. The implementation follows the discussion of http://reviews.llvm.org/D12326. Differential Revision: http://reviews.llvm.org/D16396 llvm-svn: 266719
Diffstat (limited to 'clang/test/OpenMP')
-rw-r--r--clang/test/OpenMP/parallel_ast_print.cpp3
-rw-r--r--clang/test/OpenMP/parallel_sections_ast_print.cpp3
-rw-r--r--clang/test/OpenMP/target_parallel_ast_print.cpp3
-rw-r--r--clang/test/OpenMP/task_ast_print.cpp3
-rw-r--r--clang/test/OpenMP/teams_ast_print.cpp2
-rw-r--r--clang/test/OpenMP/threadprivate_ast_print.cpp1
6 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/OpenMP/parallel_ast_print.cpp b/clang/test/OpenMP/parallel_ast_print.cpp
index 3391b2ce334..8a1533959e3 100644
--- a/clang/test/OpenMP/parallel_ast_print.cpp
+++ b/clang/test/OpenMP/parallel_ast_print.cpp
@@ -227,4 +227,7 @@ void foo(const Foo<int> &arg) {
}
}
+template<typename T>
+T S<T>::TS = 0;
+
#endif
diff --git a/clang/test/OpenMP/parallel_sections_ast_print.cpp b/clang/test/OpenMP/parallel_sections_ast_print.cpp
index 9f5c1fadbeb..a66b75ea6d7 100644
--- a/clang/test/OpenMP/parallel_sections_ast_print.cpp
+++ b/clang/test/OpenMP/parallel_sections_ast_print.cpp
@@ -141,4 +141,7 @@ int main(int argc, char **argv) {
return tmain<int, 5>(b, &b) + tmain<long, 1>(x, &x);
}
+template<typename T>
+T S<T>::TS = 0;
+
#endif
diff --git a/clang/test/OpenMP/target_parallel_ast_print.cpp b/clang/test/OpenMP/target_parallel_ast_print.cpp
index ef48dc3fa5b..1c0fca5ccfc 100644
--- a/clang/test/OpenMP/target_parallel_ast_print.cpp
+++ b/clang/test/OpenMP/target_parallel_ast_print.cpp
@@ -227,4 +227,7 @@ int main (int argc, char **argv) {
return tmain<int, 5>(argc, &argc) + tmain<char, 1>(argv[0][0], argv[0]);
}
+extern template int S<int>::TS;
+extern template char S<char>::TS;
+
#endif
diff --git a/clang/test/OpenMP/task_ast_print.cpp b/clang/test/OpenMP/task_ast_print.cpp
index da3f5e48bb0..37e5833dec5 100644
--- a/clang/test/OpenMP/task_ast_print.cpp
+++ b/clang/test/OpenMP/task_ast_print.cpp
@@ -149,4 +149,7 @@ int main(int argc, char **argv) {
return tmain<int, 5>(b, &b) + tmain<long, 1>(x, &x);
}
+extern template int S<int>::TS;
+extern template long S<long>::TS;
+
#endif
diff --git a/clang/test/OpenMP/teams_ast_print.cpp b/clang/test/OpenMP/teams_ast_print.cpp
index 292586ae530..f3d577cafcd 100644
--- a/clang/test/OpenMP/teams_ast_print.cpp
+++ b/clang/test/OpenMP/teams_ast_print.cpp
@@ -109,4 +109,6 @@ int main (int argc, char **argv) {
return tmain<int, 5>(b, &b) + tmain<long, 1>(x, &x);
}
+extern template int S<int>::TS;
+extern template long S<long>::TS;
#endif
diff --git a/clang/test/OpenMP/threadprivate_ast_print.cpp b/clang/test/OpenMP/threadprivate_ast_print.cpp
index 2d876c1909f..f789c2f277d 100644
--- a/clang/test/OpenMP/threadprivate_ast_print.cpp
+++ b/clang/test/OpenMP/threadprivate_ast_print.cpp
@@ -69,4 +69,5 @@ int main () {
return (foo<int>());
}
+extern template int ST<int>::m;
#endif
OpenPOWER on IntegriCloud