diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2015-04-16 13:49:42 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-04-16 13:49:42 +0000 |
commit | 6ddfe1a6afd4485b1858b32555a80b4ae5ce54ef (patch) | |
tree | f575b3477252d1b28d4b77fd5129b0590aac1ae5 /clang/test/OpenMP/parallel_for_copyin_messages.cpp | |
parent | 2cc44f50a5644e3ae43a6b0158315981ba87212f (diff) | |
download | bcm5719-llvm-6ddfe1a6afd4485b1858b32555a80b4ae5ce54ef.tar.gz bcm5719-llvm-6ddfe1a6afd4485b1858b32555a80b4ae5ce54ef.zip |
[OPENMP] Fix for checking of data-sharing attributes for canonical var decls only.
Currently checks for active data-sharing attributes for variables are performed for found var decls. Instead these checks must be performed for canonical decls of these variables to avoid possible troubles with with the differently qualified re-declarations of the same variable, for example:
namespace A { int x; }
namespace B { using A::x; }
Both A::x and B::x actually reference the same object A::x and this fact must be taken into account during data-sharing attributes analysis.
llvm-svn: 235096
Diffstat (limited to 'clang/test/OpenMP/parallel_for_copyin_messages.cpp')
-rw-r--r-- | clang/test/OpenMP/parallel_for_copyin_messages.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/test/OpenMP/parallel_for_copyin_messages.cpp b/clang/test/OpenMP/parallel_for_copyin_messages.cpp index bdf024ead84..f1368e98b8e 100644 --- a/clang/test/OpenMP/parallel_for_copyin_messages.cpp +++ b/clang/test/OpenMP/parallel_for_copyin_messages.cpp @@ -50,6 +50,14 @@ S4 l(3); S5 m(4); #pragma omp threadprivate(h, k, l, m) +namespace A { +double x; +#pragma omp threadprivate(x) +} +namespace B { +using A::x; +} + int main(int argc, char **argv) { int i; #pragma omp parallel for copyin // expected-error {{expected '(' after 'copyin'}} @@ -85,7 +93,7 @@ int main(int argc, char **argv) { #pragma omp parallel for copyin(m) // expected-error {{'operator=' is a private member of 'S5'}} for (i = 0; i < argc; ++i) foo(); -#pragma omp parallel for copyin(ST < int > ::s) // expected-error {{copyin variable must be threadprivate}} +#pragma omp parallel for copyin(ST<int>::s, B::x) // expected-error {{copyin variable must be threadprivate}} for (i = 0; i < argc; ++i) foo(); |