diff options
Diffstat (limited to 'clang/test/OpenMP/task_private_messages.cpp')
-rw-r--r-- | clang/test/OpenMP/task_private_messages.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/test/OpenMP/task_private_messages.cpp b/clang/test/OpenMP/task_private_messages.cpp index 0352694d579..bf2a24a4a0c 100644 --- a/clang/test/OpenMP/task_private_messages.cpp +++ b/clang/test/OpenMP/task_private_messages.cpp @@ -45,6 +45,14 @@ public: int threadvar; #pragma omp threadprivate(threadvar) // expected-note {{defined as threadprivate or thread local}} +namespace A { +double x; +#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}} +} +namespace B { +using A::x; +} + int main(int argc, char **argv) { const int d = 5; // expected-note {{constant variable is predetermined as shared}} const int da[5] = {0}; // expected-note {{constant variable is predetermined as shared}} @@ -67,7 +75,7 @@ int main(int argc, char **argv) { #pragma omp task private(da) // expected-error {{shared variable cannot be private}} #pragma omp task private(S2::S2s) #pragma omp task private(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}} -#pragma omp task private(threadvar) // expected-error {{threadprivate or thread local variable cannot be private}} +#pragma omp task private(threadvar, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be private}} #pragma omp task shared(i), private(i) // expected-error {{shared variable cannot be private}} expected-note {{defined as shared}} foo(); #pragma omp task firstprivate(i) private(i) // expected-error {{firstprivate variable cannot be private}} expected-note {{defined as firstprivate}} |