summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP/parallel_for_reduction_messages.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2017-07-20 16:47:47 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2017-07-20 16:47:47 +0000
commit4d4624c20cd970ec4f4e5ecd9d90e51443e32c0e (patch)
treec5cea877e03ac1be73cdde9af18623fce2e74635 /clang/test/OpenMP/parallel_for_reduction_messages.cpp
parent22058c3fbb6b0a0f04fdc2ba13a56022447109d0 (diff)
downloadbcm5719-llvm-4d4624c20cd970ec4f4e5ecd9d90e51443e32c0e.tar.gz
bcm5719-llvm-4d4624c20cd970ec4f4e5ecd9d90e51443e32c0e.zip
[OPENMP] Fix DSA processing for member declaration.
If the member declaration is captured in the OMPCapturedExprDecl, we may loose data-sharing attribute info for this declaration. Patch fixes this bug. llvm-svn: 308629
Diffstat (limited to 'clang/test/OpenMP/parallel_for_reduction_messages.cpp')
-rw-r--r--clang/test/OpenMP/parallel_for_reduction_messages.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/test/OpenMP/parallel_for_reduction_messages.cpp b/clang/test/OpenMP/parallel_for_reduction_messages.cpp
index 57ab1fac9c1..6499ef593a3 100644
--- a/clang/test/OpenMP/parallel_for_reduction_messages.cpp
+++ b/clang/test/OpenMP/parallel_for_reduction_messages.cpp
@@ -25,9 +25,9 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
- static const float S2sc;
+ static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
};
-const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
+const float S2::S2sc = 0;
S2 b; // expected-note 3 {{'b' defined here}}
const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
class S3 {
@@ -61,6 +61,12 @@ class S5 {
public:
S5(int v) : a(v) {}
+ void foo() {
+#pragma omp parallel private(a) // expected-note {{defined as private}}
+#pragma omp for reduction(+:a) // expected-error {{reduction variable must be shared}}
+ for (int i = 0; i < 10; ++i)
+ ::foo();
+ }
};
class S6 { // expected-note 3 {{candidate function (the implicit copy assignment operator) not viable: no known conversion from 'int' to 'const S6' for 1st argument}}
#if __cplusplus >= 201103L // C++11 or later
OpenPOWER on IntegriCloud