"threadprivate variable with incomplete type %0">;
def err_omp_no_dsa_for_variable : Error<
"variable %0 must have explicitly specified data sharing attributes">;
-def note_omp_default_dsa_none : Note<
- "explicit data sharing attribute requested here">;
def err_omp_wrong_dsa : Error<
"%0 variable cannot be %1">;
def err_omp_variably_modified_type_not_supported : Error<
DSAStack->getTopDSA(D, DSAStack->isClauseParsingMode());
if (DVarPrivate.CKind != OMPC_unknown && isOpenMPPrivate(DVarPrivate.CKind))
return VD ? VD : cast<VarDecl>(DVarPrivate.PrivateCopy->getDecl());
- if (VD && DSAStack->getDefaultDSA() == DSA_none)
- return VD;
DVarPrivate = DSAStack->hasDSA(D, isOpenMPPrivate,
[](OpenMPDirectiveKind) { return true; },
DSAStack->isClauseParsingMode());
- // The variable is not private or it is the variable in the directive with
- // default(none) clause and not used in any clause.
- if (DVarPrivate.CKind != OMPC_unknown ||
- (VD && DSAStack->getDefaultDSA() == DSA_none))
+ if (DVarPrivate.CKind != OMPC_unknown)
return VD ? VD : cast<VarDecl>(DVarPrivate.PrivateCopy->getDecl());
}
return nullptr;
for (const auto &P : VarsWithInheritedDSA) {
Diag(P.second->getExprLoc(), diag::err_omp_no_dsa_for_variable)
<< P.first << P.second->getSourceRange();
- Diag(DSAStack->getDefaultDSALocation(), diag::note_omp_default_dsa_none);
}
ErrorFound = !VarsWithInheritedDSA.empty() || ErrorFound;
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note 2 {{explicit data sharing attribute requested here}}
+#pragma omp distribute parallel for default(none // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) // expected-error 2 {{variable 'argc' must have explicitly specified data sharing attributes}}
foo();
#pragma omp target
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for default(none) // expected-note 2 {{explicit data sharing attribute requested here}}
+#pragma omp distribute parallel for default(none)
for (i = 0; i < argc; ++i) // expected-error 2 {{variable 'argc' must have explicitly specified data sharing attributes}}
foo();
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note {{explicit data sharing attribute requested here}}
+#pragma omp distribute parallel for default(none // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
foo();
#pragma omp target
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp distribute parallel for default(none)
for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
foo();
}
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp distribute parallel for default(none)
for (int i = 0; i < 10; ++i)
++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note 2 {{explicit data sharing attribute requested here}}
+#pragma omp distribute parallel for simd default(none // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) // expected-error 2 {{variable 'argc' must have explicitly specified data sharing attributes}}
foo();
#pragma omp target
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd default(none) // expected-note 2 {{explicit data sharing attribute requested here}}
+#pragma omp distribute parallel for simd default(none)
for (i = 0; i < argc; ++i) // expected-error 2 {{variable 'argc' must have explicitly specified data sharing attributes}}
foo();
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note {{explicit data sharing attribute requested here}}
+#pragma omp distribute parallel for simd default(none // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
foo();
#pragma omp target
foo();
#pragma omp target
#pragma omp teams
-#pragma omp distribute parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp distribute parallel for simd default(none)
for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
foo();
#pragma omp parallel default (x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
foo();
- #pragma omp parallel default(none) // expected-note {{explicit data sharing attribute requested here}}
+ #pragma omp parallel default(none)
++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
- #pragma omp parallel default(none) // expected-note {{explicit data sharing attribute requested here}}
+ #pragma omp parallel default(none)
#pragma omp parallel default(shared)
++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
- #pragma omp parallel default(none) // ge40-note {{explicit data sharing attribute requested here}}
+ #pragma omp parallel default(none)
(void)c; // ge40-error {{variable 'c' must have explicitly specified data sharing attributes}}
return 0;
}
#pragma omp parallel for default() // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
for (i = 0; i < argc; ++i)
foo();
-#pragma omp parallel for default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note {{explicit data sharing attribute requested here}}
+#pragma omp parallel for default(none // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
foo();
#pragma omp parallel for default(shared), default(shared) // expected-error {{directive '#pragma omp parallel for' cannot contain more than one 'default' clause}}
for (i = 0; i < argc; ++i)
foo();
-#pragma omp parallel for default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp parallel for default(none)
for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
foo();
-#pragma omp parallel default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp parallel default(none)
#pragma omp parallel for default(shared)
for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
foo();
break;
}
}
-#pragma omp parallel for default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp parallel for default(none)
for (int i = 0; i < 10; ++i)
++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
#pragma omp parallel for simd default() // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
for (i = 0; i < argc; ++i)
foo();
-#pragma omp parallel for simd default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note {{explicit data sharing attribute requested here}}
+#pragma omp parallel for simd default(none // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
foo();
#pragma omp parallel for simd default(shared), default(shared) // expected-error {{directive '#pragma omp parallel for simd' cannot contain more than one 'default' clause}}
for (i = 0; i < argc; ++i)
foo();
-#pragma omp parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp parallel for simd default(none)
for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
foo();
-#pragma omp parallel default(none) // expected-note 2 {{explicit data sharing attribute requested here}}
+#pragma omp parallel default(none)
#pragma omp parallel for simd default(shared)
for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} expected-error {{variable 'i' must have explicitly specified data sharing attributes}}
foo();
break;
}
}
-#pragma omp parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp parallel for simd default(none)
for (int i = 0; i < 10; ++i)
++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
#pragma omp parallel // expected-error {{unexpected OpenMP directive '#pragma omp parallel'}}
-int a;
struct S;
S& bar();
int main(int argc, char **argv) {
break;
}
}
-#pragma omp parallel default(none) // expected-note 2 {{explicit data sharing attribute requested here}}
- {
- ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
- ++a; // expected-error {{variable 'a' must have explicitly specified data sharing attributes}}
- }
+ #pragma omp parallel default(none)
+ ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
goto L2; // expected-error {{use of undeclared label 'L2'}}
#pragma omp parallel
}
}
-#pragma omp parallel sections default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp parallel sections default(none)
{
++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
}
-#pragma omp parallel sections default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp parallel sections default(none)
{
#pragma omp parallel sections default(shared)
{
break;
}
}
-#pragma omp parallel sections default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp parallel sections default(none)
{
++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
}
for (int iter = 0; iter < x; iter++) {
#pragma omp target teams distribute parallel for map( \
from \
- : vec [0:n]) default(none) // expected-note 4 {{explicit data sharing attribute requested here}}
+ : vec [0:n]) default(none)
// expected-error@+1 {{variable 'n' must have explicitly specified data sharing attributes}}
for (int ii = 0; ii < n; ii++) {
// expected-error@+3 {{variable 'iter' must have explicitly specified data sharing attributes}}
#pragma omp target parallel default (x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
foo();
- #pragma omp target parallel default(none) // expected-note {{explicit data sharing attribute requested here}}
+ #pragma omp target parallel default(none)
++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
#pragma omp target parallel default(none)
foo();
#pragma omp target parallel default(shared)
++argc;
- #pragma omp target parallel default(none) // expected-note {{explicit data sharing attribute requested here}}
+ #pragma omp target parallel default(none)
#pragma omp parallel default(shared)
++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
return 0;
#pragma omp target parallel for default() // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
for (i = 0; i < argc; ++i)
foo();
-#pragma omp target parallel for default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note {{explicit data sharing attribute requested here}}
+#pragma omp target parallel for default(none // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
foo();
#pragma omp target parallel for default(shared), default(shared) // expected-error {{directive '#pragma omp target parallel for' cannot contain more than one 'default' clause}}
for (i = 0; i < argc; ++i)
foo();
-#pragma omp target parallel for default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp target parallel for default(none)
for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
foo();
break;
}
}
-#pragma omp target parallel for default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp target parallel for default(none)
for (int i = 0; i < 10; ++i)
++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
#pragma omp target parallel for simd default() // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
for (i = 0; i < argc; ++i)
foo();
-#pragma omp target parallel for simd default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note {{explicit data sharing attribute requested here}}
+#pragma omp target parallel for simd default(none // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
foo();
#pragma omp target parallel for simd default(shared), default(shared) // expected-error {{directive '#pragma omp target parallel for simd' cannot contain more than one 'default' clause}}
for (i = 0; i < argc; ++i)
foo();
-#pragma omp target parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp target parallel for simd default(none)
for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
foo();
break;
}
}
-#pragma omp target parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp target parallel for simd default(none)
for (int i = 0; i < 10; ++i)
++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
#pragma omp target teams default (x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
foo();
-#pragma omp target teams default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp target teams default(none)
++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
-#pragma omp target teams default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp target teams default(none)
#pragma omp parallel default(shared)
++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
return 0;
#pragma omp target teams distribute default (x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
for (int i=0; i<200; i++) foo();
- #pragma omp target teams distribute default(none) // expected-note {{explicit data sharing attribute requested here}}
+ #pragma omp target teams distribute default(none)
for (int i=0; i<200; i++) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
return 0;
break;
}
}
-#pragma omp target teams distribute default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp target teams distribute default(none)
for (int i = 0; i < 10; ++i)
++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
#pragma omp target teams distribute parallel for default (x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
for (int i=0; i<200; i++) foo();
-#pragma omp target teams distribute parallel for default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp target teams distribute parallel for default(none)
for (int i=0; i<200; i++) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
return 0;
break;
}
}
-#pragma omp target teams distribute parallel for default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp target teams distribute parallel for default(none)
for (int i = 0; i < 10; ++i)
++argc; // expected-error {{ariable 'argc' must have explicitly specified data sharing attributes}}
#pragma omp target teams distribute parallel for simd default (x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
for (int i=0; i<200; i++) foo();
-#pragma omp target teams distribute parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp target teams distribute parallel for simd default(none)
for (int i=0; i<200; i++) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
return 0;
break;
}
}
-#pragma omp target teams distribute parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp target teams distribute parallel for simd default(none)
for (int i = 0; i < 10; ++i)
++argc; // expected-error {{ariable 'argc' must have explicitly specified data sharing attributes}}
break;
}
}
-#pragma omp target teams default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp target teams default(none)
++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
-#pragma omp target teams default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp target teams default(none)
#pragma omp parallel num_threads(argc) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
;
-#pragma omp target teams default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp target teams default(none)
{
#pragma omp parallel num_threads(argc) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
;
#pragma omp task default(x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
foo();
-#pragma omp task default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp task default(none)
++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
-#pragma omp task default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp task default(none)
#pragma omp task default(shared)
++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
return 0;
struct S {
T b;
S(T a, T c) {
-#pragma omp task default(none) firstprivate(a, b) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp task default(none) firstprivate(a, b)
a = b = c; // expected-error {{variable 'c' must have explicitly specified data sharing attributes}}
}
};
#pragma omp task
// expected-note@+1 2 {{predetermined as a firstprivate in a task construct here}}
++s1;
-#pragma omp task default(none) // expected-note 2 {{explicit data sharing attribute requested here}}
+#pragma omp task default(none)
#pragma omp task default(shared)
++a; // expected-error 2 {{variable 'a' must have explicitly specified data sharing attributes}}
-#pragma omp task default(none) // expected-note 2 {{explicit data sharing attribute requested here}}
+#pragma omp task default(none)
#pragma omp task
// expected-error@+1 {{calling a private constructor of class 'S'}}
++a; // expected-error 2 {{variable 'a' must have explicitly specified data sharing attributes}}
break;
}
}
-#pragma omp task default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp task default(none)
++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
goto L2; // expected-error {{use of undeclared label 'L2'}}
for (int n = 0; n < 100; ++n) {
}
-#pragma omp task default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp task default(none)
#pragma omp task default(shared)
++a; // expected-error {{variable 'a' must have explicitly specified data sharing attributes}}
-#pragma omp task default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp task default(none)
#pragma omp task
++a; // expected-error {{variable 'a' must have explicitly specified data sharing attributes}}
#pragma omp task default(shared)
#pragma omp task
#pragma omp parallel shared(a, b)
++a, ++b;
-#pragma omp task default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp task default(none)
#pragma omp task default(shared)
++sa; // expected-error {{variable 'sa' must have explicitly specified data sharing attributes}}
-#pragma omp task default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp task default(none)
#pragma omp task
// expected-error@+1 {{calling a private constructor of class 'S'}}
++sa; // expected-error {{variable 'sa' must have explicitly specified data sharing attributes}}
foo();
#pragma omp target
- #pragma omp teams default(none) // expected-note {{explicit data sharing attribute requested here}}
+ #pragma omp teams default(none)
++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
#pragma omp target
- #pragma omp teams default(none) // expected-note {{explicit data sharing attribute requested here}}
+ #pragma omp teams default(none)
#pragma omp parallel default(shared)
++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
return 0;
for (int i=0; i<200; i++) foo();
#pragma omp target
- #pragma omp teams distribute default(none) // expected-note {{explicit data sharing attribute requested here}}
+ #pragma omp teams distribute default(none)
for (int i=0; i<200; i++) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
return 0;
for (int i=0; i<200; i++) foo();
#pragma omp target
- #pragma omp teams distribute parallel for default(none) // expected-note {{explicit data sharing attribute requested here}}
+ #pragma omp teams distribute parallel for default(none)
for (int i=0; i<200; i++) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
return 0;
}
}
#pragma omp target
-#pragma omp teams distribute parallel for default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp teams distribute parallel for default(none)
for (int i = 0; i < 10; ++i)
++argc; // expected-error {{ariable 'argc' must have explicitly specified data sharing attributes}}
for (int i=0; i<200; i++) foo();
#pragma omp target
- #pragma omp teams distribute parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}}
+ #pragma omp teams distribute parallel for simd default(none)
for (int i=0; i<200; i++) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
return 0;
}
}
#pragma omp target
-#pragma omp teams distribute parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp teams distribute parallel for simd default(none)
for (int i = 0; i < 10; ++i)
++argc; // expected-error {{ariable 'argc' must have explicitly specified data sharing attributes}}
for (int i=0; i<200; i++) foo();
#pragma omp target
- #pragma omp teams distribute simd default(none) // expected-note {{explicit data sharing attribute requested here}}
+ #pragma omp teams distribute simd default(none)
for (int i=0; i<200; i++) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
return 0;
}
}
#pragma omp target
-#pragma omp teams distribute simd default(none) // expected-note {{explicit data sharing attribute requested here}}
+#pragma omp teams distribute simd default(none)
for (int i = 0; i < 10; ++i)
++argc; // expected-error {{ariable 'argc' must have explicitly specified data sharing attributes}}
}
}
#pragma omp target
- #pragma omp teams default(none) // expected-note {{explicit data sharing attribute requested here}}
+ #pragma omp teams default(none)
++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
goto L2; // expected-error {{use of undeclared label 'L2'}}