Index: cfe/trunk/test/OpenMP/distribute_collapse_messages.cpp =================================================================== --- cfe/trunk/test/OpenMP/distribute_collapse_messages.cpp +++ cfe/trunk/test/OpenMP/distribute_collapse_messages.cpp @@ -1,8 +1,13 @@ // RUN: %clang_cc1 -verify -fopenmp %s +// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s +// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s void foo() { } +#if __cplusplus >= 201103L + // expected-note@+2 4 {{declared here}} +#endif bool foobool(int argc) { return argc; } @@ -29,6 +34,9 @@ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; #pragma omp distribute collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp distribute', but found only 1}} +#if __cplusplus >= 201103L + // expected-note@+5 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} +#endif // expected-error@+3 2 {{directive '#pragma omp distribute' cannot contain more than one 'collapse' clause}} // expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+1 2 {{expression is not an integral constant expression}} @@ -36,7 +44,11 @@ for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; #pragma omp distribute collapse (S) // expected-error {{'S' does not refer to a value}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; - // expected-error@+1 2 {{expression is not an integral constant expression}} +#if __cplusplus <= 199711L + // expected-error@+4 2 {{expression is not an integral constant expression}} +#else + // expected-error@+2 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}} +#endif #pragma omp distribute collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; #pragma omp distribute collapse (1) @@ -59,8 +71,14 @@ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp distribute', but found only 1}} #pragma omp distribute collapse (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp distribute' are ignored}} expected-note {{as specified in 'collapse' clause}} for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp distribute', but found only 1}} +#if __cplusplus >= 201103L + // expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} +#endif #pragma omp distribute collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}} for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; +#if __cplusplus >= 201103L + // expected-note@+5 {{non-constexpr function 'foobool' cannot be used in a constant expression}} +#endif // expected-error@+3 {{expression is not an integral constant expression}} // expected-error@+2 2 {{directive '#pragma omp distribute' cannot contain more than one 'collapse' clause}} // expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} @@ -68,7 +86,11 @@ for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp distribute collapse (S1) // expected-error {{'S1' does not refer to a value}} for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; - // expected-error@+1 {{expression is not an integral constant expression}} +#if __cplusplus <= 199711L + // expected-error@+4 {{expression is not an integral constant expression}} +#else + // expected-error@+2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}} +#endif #pragma omp distribute collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}} for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error@+3 {{statement after '#pragma omp distribute' must be a for loop}} Index: cfe/trunk/test/OpenMP/ordered_messages.cpp =================================================================== --- cfe/trunk/test/OpenMP/ordered_messages.cpp +++ cfe/trunk/test/OpenMP/ordered_messages.cpp @@ -1,4 +1,6 @@ // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s +// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++98 -o - %s +// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 -o - %s int foo(); @@ -123,6 +125,9 @@ #pragma omp ordered depend(sink : j, i) // expected-error {{expected 'i' loop iteration variable}} expected-error {{expected 'j' loop iteration variable}} #pragma omp ordered depend(sink : i, j, k) // expected-error {{unexpected expression: number of expressions is larger than the number of associated loops}} #pragma omp ordered depend(sink : i+foo(), j/4) // expected-error {{expression is not an integral constant expression}} expected-error {{expected '+' or '-' operation}} +#if __cplusplus >= 201103L +// expected-note@-2 {{non-constexpr function 'foo' cannot be used in a constant expression}} +#endif #pragma omp ordered depend(sink : i*0, j-4)// expected-error {{expected '+' or '-' operation}} #pragma omp ordered depend(sink : i-0, j+sizeof(T)) depend(sink : i-0, j+sizeof(T)) #pragma omp ordered depend(sink : i-0, j+sizeof(T)) depend(source) // expected-error {{'depend(source)' clause cannot be mixed with 'depend(sink:vec)' clauses}} @@ -133,6 +138,9 @@ } int foo() { +#if __cplusplus >= 201103L +// expected-note@-2 2 {{declared here}} +#endif int k; #pragma omp for ordered for (int i = 0; i < 10; ++i) { @@ -252,6 +260,9 @@ #pragma omp ordered depend(sink : j, i) // expected-error {{expected 'i' loop iteration variable}} expected-error {{expected 'j' loop iteration variable}} #pragma omp ordered depend(sink : i, j, k) // expected-error {{unexpected expression: number of expressions is larger than the number of associated loops}} #pragma omp ordered depend(sink : i+foo(), j/4) // expected-error {{expression is not an integral constant expression}} expected-error {{expected '+' or '-' operation}} +#if __cplusplus >= 201103L +// expected-note@-2 {{non-constexpr function 'foo' cannot be used in a constant expression}} +#endif #pragma omp ordered depend(sink : i*0, j-4)// expected-error {{expected '+' or '-' operation}} #pragma omp ordered depend(sink : i-0, j+sizeof(int)) depend(sink : i-0, j+sizeof(int)) #pragma omp ordered depend(sink : i-0, j+sizeof(int)) depend(source) // expected-error {{'depend(source)' clause cannot be mixed with 'depend(sink:vec)' clauses}} Index: cfe/trunk/test/OpenMP/target_parallel_for_collapse_messages.cpp =================================================================== --- cfe/trunk/test/OpenMP/target_parallel_for_collapse_messages.cpp +++ cfe/trunk/test/OpenMP/target_parallel_for_collapse_messages.cpp @@ -1,9 +1,14 @@ // RUN: %clang_cc1 -verify -fopenmp %s +// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s +// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s void foo() { } bool foobool(int argc) { +#if __cplusplus >= 201103L +// expected-note@-2 4 {{declared here}} +#endif return argc; } @@ -33,10 +38,17 @@ // expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}} // expected-error@+1 2 {{expression is not an integral constant expression}} #pragma omp target parallel for collapse (foobool(argc)), collapse (true), collapse (-5) +#if __cplusplus >= 201103L +// expected-note@-2 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} +#endif for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; #pragma omp target parallel for collapse (S) // expected-error {{'S' does not refer to a value}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; - // expected-error@+1 2 {{expression is not an integral constant expression}} +#if __cplusplus >= 201103L + // expected-error@+4 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}} +#else + // expected-error@+2 2 {{expression is not an integral constant expression}} +#endif #pragma omp target parallel for collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i-ST]; #pragma omp target parallel for collapse (1) @@ -60,15 +72,25 @@ #pragma omp target parallel for collapse (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp target parallel for' are ignored}} expected-note {{as specified in 'collapse' clause}} for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp target parallel for', but found only 1}} #pragma omp target parallel for collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}} +#if __cplusplus >= 201103L +// expected-note@-2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} +#endif for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error@+3 {{expression is not an integral constant expression}} // expected-error@+2 2 {{directive '#pragma omp target parallel for' cannot contain more than one 'collapse' clause}} // expected-error@+1 2 {{argument to 'collapse' clause must be a strictly positive integer value}} #pragma omp target parallel for collapse (foobool(argc)), collapse (true), collapse (-5) +#if __cplusplus >= 201103L +// expected-note@-2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} +#endif for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; #pragma omp target parallel for collapse (S1) // expected-error {{'S1' does not refer to a value}} for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; - // expected-error@+1 {{expression is not an integral constant expression}} +#if __cplusplus >= 201103L + // expected-error@+4 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}} +#else + // expected-error@+2 {{expression is not an integral constant expression}} +#endif #pragma omp target parallel for collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}} for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error@+3 {{statement after '#pragma omp target parallel for' must be a for loop}} Index: cfe/trunk/test/OpenMP/target_parallel_for_ordered_messages.cpp =================================================================== --- cfe/trunk/test/OpenMP/target_parallel_for_ordered_messages.cpp +++ cfe/trunk/test/OpenMP/target_parallel_for_ordered_messages.cpp @@ -1,9 +1,14 @@ // RUN: %clang_cc1 -verify -fopenmp %s +// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s +// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s void foo() { } bool foobool(int argc) { +#if __cplusplus >= 201103L +// expected-note@-2 4 {{declared here}} +#endif return argc; } @@ -36,6 +41,9 @@ #pragma omp target parallel for ordered((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'ordered' clause}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i - ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp target parallel for', but found only 1}} +#if __cplusplus >= 201103L +// expected-note@+5 2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} +#endif // expected-error@+3 2 {{directive '#pragma omp target parallel for' cannot contain more than one 'ordered' clause}} // expected-error@+2 2 {{argument to 'ordered' clause must be a strictly positive integer value}} // expected-error@+1 2 {{expression is not an integral constant expression}} @@ -45,7 +53,11 @@ #pragma omp target parallel for ordered(S) // expected-error {{'S' does not refer to a value}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i - ST]; -// expected-error@+1 2 {{expression is not an integral constant expression}} +#if __cplusplus >= 201103L + // expected-error@+4 2 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}} +#else + // expected-error@+2 2 {{expression is not an integral constant expression}} +#endif #pragma omp target parallel for ordered(argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}} for (int i = ST; i < N; i++) argv[0][i] = argv[0][i] - argv[0][i - ST]; @@ -76,9 +88,15 @@ #pragma omp target parallel for ordered(2 + 2)) // expected-warning {{extra tokens at the end of '#pragma omp target parallel for' are ignored}} expected-note {{as specified in 'ordered' clause}} for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i - 4]; // expected-error {{expected 4 for loops after '#pragma omp target parallel for', but found only 1}} +#if __cplusplus >= 201103L +// expected-note@+2 {{non-constexpr function 'foobool' cannot be used in a constant expression}} +#endif #pragma omp target parallel for ordered(foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}} for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i - 4]; +#if __cplusplus >= 201103L +// expected-note@+5 {{non-constexpr function 'foobool' cannot be used in a constant expression}} +#endif // expected-error@+3 {{expression is not an integral constant expression}} // expected-error@+2 2 {{directive '#pragma omp target parallel for' cannot contain more than one 'ordered' clause}} // expected-error@+1 2 {{argument to 'ordered' clause must be a strictly positive integer value}} @@ -88,7 +106,11 @@ #pragma omp target parallel for ordered(S1) // expected-error {{'S1' does not refer to a value}} for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i - 4]; -// expected-error@+1 {{expression is not an integral constant expression}} +#if __cplusplus >= 201103L + // expected-error@+4 {{integral constant expression must have integral or unscoped enumeration type, not 'char *'}} +#else + // expected-error@+2 {{expression is not an integral constant expression}} +#endif #pragma omp target parallel for ordered(argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}} for (int i = 4; i < 12; i++) argv[0][i] = argv[0][i] - argv[0][i - 4];