diff options
author | David Sheinkman <davidsheinkman@outlook.com> | 2016-10-06 15:47:36 +0000 |
---|---|---|
committer | David Sheinkman <davidsheinkman@outlook.com> | 2016-10-06 15:47:36 +0000 |
commit | d03c85c02ec444cddb0d5d098e9164dbe59e5bde (patch) | |
tree | a6b0a9d43fd348d8c8abce77dd2d7d995f54ac49 /clang/test/OpenMP/target_map_messages.cpp | |
parent | 36919a4f7c3e8d38c2db427b6957d6402a3f8322 (diff) | |
download | bcm5719-llvm-d03c85c02ec444cddb0d5d098e9164dbe59e5bde.tar.gz bcm5719-llvm-d03c85c02ec444cddb0d5d098e9164dbe59e5bde.zip |
[OpenMP] Check if the template specialization is mappable instead of specialized template Differential Revision: https://reviews.llvm.org/D25252
llvm-svn: 283460
Diffstat (limited to 'clang/test/OpenMP/target_map_messages.cpp')
-rw-r--r-- | clang/test/OpenMP/target_map_messages.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/OpenMP/target_map_messages.cpp b/clang/test/OpenMP/target_map_messages.cpp index a3b2168fedb..93f0216dd23 100644 --- a/clang/test/OpenMP/target_map_messages.cpp +++ b/clang/test/OpenMP/target_map_messages.cpp @@ -347,6 +347,15 @@ public: S5(int v):a(v) { } }; +template <class T> +struct S6; + +template<> +struct S6<int> // expected-note {{mappable type cannot be polymorphic}} +{ + virtual void foo(); +}; + S3 h; #pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}} @@ -451,6 +460,7 @@ int main(int argc, char **argv) { int i; int &j = i; int *k = &j; + S6<int> m; int x; int y; int to, tofrom, always; @@ -513,6 +523,8 @@ int main(int argc, char **argv) { {} #pragma omp target firstprivate(j) map(j) // expected-error {{firstprivate variable cannot be in a map clause in '#pragma omp target' directive}} expected-note {{defined as firstprivate}} {} +#pragma omp target map(m) // expected-error {{type 'S6<int>' is not mappable to target}} + {} return tmain<int, 3>(argc)+tmain<from, 4>(argc); // expected-note {{in instantiation of function template specialization 'tmain<int, 3>' requested here}} expected-note {{in instantiation of function template specialization 'tmain<int, 4>' requested here}} } #endif |