1 // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized
3 // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 -std=c++11 -o - %s -Wuninitialized
9 int x
; // expected-note {{initialize the variable 'x' to silence this warning}}
11 argc
= x
; // expected-warning {{variable 'x' is uninitialized when used here}}
14 #pragma omp parallel // expected-error {{unexpected OpenMP directive '#pragma omp parallel'}}
19 int main(int argc
, char **argv
) {
23 #pragma omp parallel { // expected-warning {{extra tokens at the end of '#pragma omp parallel' are ignored}}
25 #pragma omp parallel ( // expected-warning {{extra tokens at the end of '#pragma omp parallel' are ignored}}
27 #pragma omp parallel [ // expected-warning {{extra tokens at the end of '#pragma omp parallel' are ignored}}
29 #pragma omp parallel ] // expected-warning {{extra tokens at the end of '#pragma omp parallel' are ignored}}
31 #pragma omp parallel ) // expected-warning {{extra tokens at the end of '#pragma omp parallel' are ignored}}
33 #pragma omp parallel } // expected-warning {{extra tokens at the end of '#pragma omp parallel' are ignored}}
36 // expected-warning@+1 {{extra tokens at the end of '#pragma omp parallel' are ignored}}
37 #pragma omp parallel unknown()
41 #pragma omp parallel ordered // expected-error {{unexpected OpenMP clause 'ordered' in directive '#pragma omp parallel'}}
47 goto L1
; // expected-error {{use of undeclared label 'L1'}}
51 for (int i
= 0; i
< 10; ++i
) {
57 break; // expected-error {{'break' statement not in loop or switch statement}}
58 continue; // expected-error {{'continue' statement not in loop statement}}
64 #pragma omp parallel default(none) // expected-note 2 {{explicit data sharing attribute requested here}}
66 ++argc
; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
67 ++a
; // expected-error {{variable 'a' must have explicitly specified data sharing attributes}}
70 goto L2
; // expected-error {{use of undeclared label 'L2'}}
76 return 1; // expected-error {{cannot return from OpenMP region}}
79 [[]] // expected-error {{an attribute list cannot appear here}}
81 for (int n
= 0; n
< 100; ++n
) {}
87 static constexpr int b
= 0;
89 template <bool> struct c
;
90 template <typename d
, typename e
> bool operator<(d
, e
);
98 template <typename
> struct is_error_code_enum
: a
{};
100 template <typename i
, typename
= c
<is_error_code_enum
<i
>::b
>> h(i
);
104 #pragma omp parallel for default(none) if(a::b)
105 for (auto a
= blocks
.cbegin
; a
< blocks
; ++a
) // expected-error 2 {{invalid operands to binary expression ('f' and 'int')}}