Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/gomp/tpl-atomic-2.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 04ced10e8804 |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
4 | 4 |
5 // Make sure we detect errors on non-type-dependent things | 5 // Make sure we detect errors on non-type-dependent things |
6 // even when the templates are never instantiated. | 6 // even when the templates are never instantiated. |
7 template<typename T> void f1() | 7 template<typename T> void f1() |
8 { | 8 { |
9 #pragma omp atomic | 9 #pragma omp atomic // { dg-error "invalid" } |
10 s += 1; // { dg-error "invalid" } | 10 s += 1; |
11 } | 11 } |
12 | 12 |
13 template<typename T> void f2(float *f) | 13 template<typename T> void f2(float *f) |
14 { | 14 { |
15 #pragma omp atomic | 15 #pragma omp atomic // { dg-error "invalid" } |
16 *f |= 1; // { dg-error "invalid|evaluation" } | 16 *f |= 1; // { dg-message "evaluation" "" { target *-*-* } .-1 } |
17 } | 17 } |
18 | 18 |
19 // Here the rhs is dependent, but not type dependent. | 19 // Here the rhs is dependent, but not type dependent. |
20 template<typename T> void f3(float *f) | 20 template<typename T> void f3(float *f) |
21 { | 21 { |
22 #pragma omp atomic | 22 #pragma omp atomic // { dg-error "invalid" } |
23 *f |= sizeof (T); // { dg-error "invalid|evaluation" } | 23 *f |= sizeof (T); // { dg-message "evaluation" "" { target *-*-* } .-1 } |
24 } | 24 } |
25 | 25 |
26 // And the converse, no error here because we're never fed a T. | 26 // And the converse, no error here because we're never fed a T. |
27 template<typename T> void f4(T *t) | 27 template<typename T> void f4(T *t) |
28 { | 28 { |
33 // Here we'll let it go, because the rhs is type dependent and | 33 // Here we'll let it go, because the rhs is type dependent and |
34 // we can't properly instantiate the statement, and we do most | 34 // we can't properly instantiate the statement, and we do most |
35 // of the semantic analysis concurrent with that. | 35 // of the semantic analysis concurrent with that. |
36 template<typename T> void f5(float *f) | 36 template<typename T> void f5(float *f) |
37 { | 37 { |
38 #pragma omp atomic | 38 #pragma omp atomic // { dg-error "invalid" "" { xfail *-*-* } } |
39 *f |= (T)sizeof(T); // { dg-error "invalid|evaluation" "" { xfail *-*-* } } | 39 *f |= (T)sizeof(T); // { dg-error "evaluation" "" { xfail *-*-* } } |
40 } | 40 } |