master_taskloop_in_reduction_messages.cpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s -Wuninitialized
  2. // RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
  3. // RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
  4. // RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 150 -o - %s -Wuninitialized
  5. // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++98 -ferror-limit 150 -o - %s -Wuninitialized
  6. // RUN: %clang_cc1 -verify -fopenmp-simd -std=c++11 -ferror-limit 150 -o - %s -Wuninitialized
  7. typedef void **omp_allocator_handle_t;
  8. extern const omp_allocator_handle_t omp_default_mem_alloc;
  9. extern const omp_allocator_handle_t omp_large_cap_mem_alloc;
  10. extern const omp_allocator_handle_t omp_const_mem_alloc;
  11. extern const omp_allocator_handle_t omp_high_bw_mem_alloc;
  12. extern const omp_allocator_handle_t omp_low_lat_mem_alloc;
  13. extern const omp_allocator_handle_t omp_cgroup_mem_alloc;
  14. extern const omp_allocator_handle_t omp_pteam_mem_alloc;
  15. extern const omp_allocator_handle_t omp_thread_mem_alloc;
  16. void foo() {
  17. }
  18. bool foobool(int argc) {
  19. return argc;
  20. }
  21. void foobar(int &ref) {
  22. #pragma omp taskgroup task_reduction(+:ref)
  23. #pragma omp master taskloop in_reduction(+:ref)
  24. for (int i = 0; i < 10; ++i)
  25. foo();
  26. }
  27. void foobar1(int &ref) {
  28. #pragma omp taskgroup task_reduction(+:ref)
  29. #pragma omp master taskloop in_reduction(-:ref)
  30. for (int i = 0; i < 10; ++i)
  31. foo();
  32. }
  33. #pragma omp declare reduction (red:int:omp_out += omp_in)
  34. void foobar2(int &ref) {
  35. #pragma omp taskgroup task_reduction(+:ref) // expected-note {{previously marked as task_reduction with different reduction operation}}
  36. #pragma omp master taskloop in_reduction(red:ref) // expected-error{{in_reduction variable must have the same reduction operation as in a task_reduction clause}}
  37. for (int i = 0; i < 10; ++i)
  38. foo();
  39. }
  40. void foobar3(int &ref) {
  41. #pragma omp taskgroup task_reduction(red:ref) // expected-note {{previously marked as task_reduction with different reduction operation}}
  42. #pragma omp master taskloop in_reduction(min:ref) // expected-error{{in_reduction variable must have the same reduction operation as in a task_reduction clause}}
  43. for (int i = 0; i < 10; ++i)
  44. foo();
  45. }
  46. void foobar4(int &ref) {
  47. #pragma omp master taskloop in_reduction(min:ref) // expected-error {{in_reduction variable must appear in a task_reduction clause}}
  48. for (int i = 0; i < 10; ++i)
  49. foo();
  50. }
  51. struct S1; // expected-note {{declared here}} expected-note 4 {{forward declaration of 'S1'}}
  52. extern S1 a;
  53. class S2 {
  54. mutable int a;
  55. S2 &operator+(const S2 &arg) { return (*this); } // expected-note 3 {{implicitly declared private here}}
  56. public:
  57. S2() : a(0) {}
  58. S2(S2 &s2) : a(s2.a) {}
  59. static float S2s; // expected-note 2 {{static data member is predetermined as shared}}
  60. static const float S2sc; // expected-note 2 {{'S2sc' declared here}}
  61. };
  62. const float S2::S2sc = 0;
  63. S2 b; // expected-note 3 {{'b' defined here}}
  64. const S2 ba[5]; // expected-note 2 {{'ba' defined here}}
  65. class S3 {
  66. int a;
  67. public:
  68. int b;
  69. S3() : a(0) {}
  70. S3(const S3 &s3) : a(s3.a) {}
  71. S3 operator+(const S3 &arg1) { return arg1; }
  72. };
  73. int operator+(const S3 &arg1, const S3 &arg2) { return 5; }
  74. S3 c; // expected-note 3 {{'c' defined here}}
  75. const S3 ca[5]; // expected-note 2 {{'ca' defined here}}
  76. extern const int f; // expected-note 4 {{'f' declared here}}
  77. class S4 {
  78. int a;
  79. S4(); // expected-note {{implicitly declared private here}}
  80. S4(const S4 &s4);
  81. S4 &operator+(const S4 &arg) { return (*this); }
  82. public:
  83. S4(int v) : a(v) {}
  84. };
  85. S4 &operator&=(S4 &arg1, S4 &arg2) { return arg1; }
  86. class S5 {
  87. int a;
  88. S5() : a(0) {} // expected-note {{implicitly declared private here}}
  89. S5(const S5 &s5) : a(s5.a) {}
  90. S5 &operator+(const S5 &arg);
  91. public:
  92. S5(int v) : a(v) {}
  93. };
  94. 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}}
  95. #if __cplusplus >= 201103L // C++11 or later
  96. // expected-note@-2 3 {{candidate function (the implicit move assignment operator) not viable}}
  97. #endif
  98. int a;
  99. public:
  100. S6() : a(6) {}
  101. operator int() { return 6; }
  102. } o;
  103. S3 h, k;
  104. #pragma omp threadprivate(h) // expected-note 2 {{defined as threadprivate or thread local}}
  105. template <class T> // expected-note {{declared here}}
  106. T tmain(T argc) {
  107. const T d = T(); // expected-note 4 {{'d' defined here}}
  108. const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
  109. T qa[5] = {T()};
  110. T i;
  111. T &j = i; // expected-note 2 {{'j' defined here}}
  112. S3 &p = k; // expected-note 2 {{'p' defined here}}
  113. const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
  114. T &q = qa[(int)i];
  115. T fl;
  116. #pragma omp taskgroup task_reduction(+:argc)
  117. #pragma omp master taskloop in_reduction // expected-error {{expected '(' after 'in_reduction'}}
  118. for (int i = 0; i < 10; ++i)
  119. foo();
  120. #pragma omp taskgroup task_reduction(+:argc)
  121. #pragma omp master taskloop in_reduction + // expected-error {{expected '(' after 'in_reduction'}} expected-warning {{extra tokens at the end of '#pragma omp master taskloop' are ignored}}
  122. for (int i = 0; i < 10; ++i)
  123. foo();
  124. #pragma omp taskgroup task_reduction(+:argc)
  125. #pragma omp master taskloop in_reduction( // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  126. for (int i = 0; i < 10; ++i)
  127. foo();
  128. #pragma omp taskgroup task_reduction(+:argc)
  129. #pragma omp master taskloop in_reduction(- // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  130. for (int i = 0; i < 10; ++i)
  131. foo();
  132. #pragma omp taskgroup task_reduction(+:argc)
  133. #pragma omp master taskloop in_reduction() // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
  134. for (int i = 0; i < 10; ++i)
  135. foo();
  136. #pragma omp taskgroup task_reduction(+:argc)
  137. #pragma omp master taskloop in_reduction(*) // expected-warning {{missing ':' after reduction identifier - ignoring}}
  138. for (int i = 0; i < 10; ++i)
  139. foo();
  140. #pragma omp taskgroup task_reduction(+:argc)
  141. #pragma omp master taskloop in_reduction(\) // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
  142. for (int i = 0; i < 10; ++i)
  143. foo();
  144. #pragma omp taskgroup task_reduction(&:argc) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
  145. #pragma omp master taskloop in_reduction(& : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{invalid operands to binary expression ('float' and 'float')}}
  146. for (int i = 0; i < 10; ++i)
  147. foo();
  148. #pragma omp taskgroup task_reduction(|:argc) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
  149. #pragma omp master taskloop in_reduction(| : argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{invalid operands to binary expression ('float' and 'float')}}
  150. for (int i = 0; i < 10; ++i)
  151. foo();
  152. #pragma omp master taskloop in_reduction(|| : argc ? i : argc) // expected-error 2 {{expected variable name, array element or array section}}
  153. for (int i = 0; i < 10; ++i)
  154. foo();
  155. #pragma omp master taskloop in_reduction(foo : argc) //expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'float'}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'}}
  156. for (int i = 0; i < 10; ++i)
  157. foo();
  158. #pragma omp taskgroup task_reduction(&&:argc)
  159. #pragma omp master taskloop in_reduction(&& : argc) allocate , allocate(, allocate(omp_default , allocate(omp_default_mem_alloc, allocate(omp_default_mem_alloc:, allocate(omp_default_mem_alloc: argc, allocate(omp_default_mem_alloc: argv), allocate(argv) // expected-error {{expected '(' after 'allocate'}} expected-error 2 {{expected expression}} expected-error 2 {{expected ')'}} expected-error {{use of undeclared identifier 'omp_default'}} expected-note 2 {{to match this '('}}
  160. for (int i = 0; i < 10; ++i)
  161. foo();
  162. #pragma omp master taskloop in_reduction(^ : T) // expected-error {{'T' does not refer to a value}}
  163. for (int i = 0; i < 10; ++i)
  164. foo();
  165. #pragma omp taskgroup task_reduction(+:c)
  166. #pragma omp master taskloop in_reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be in_reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}} expected-error 2 {{in_reduction variable must appear in a task_reduction clause}}
  167. for (int i = 0; i < 10; ++i)
  168. foo();
  169. #pragma omp master taskloop in_reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'in_reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified variable cannot be in_reduction}}
  170. for (int i = 0; i < 10; ++i)
  171. foo();
  172. #pragma omp master taskloop in_reduction(max : h.b) // expected-error {{expected variable name, array element or array section}}
  173. for (int i = 0; i < 10; ++i)
  174. foo();
  175. #pragma omp master taskloop in_reduction(+ : ba) // expected-error {{const-qualified variable cannot be in_reduction}}
  176. for (int i = 0; i < 10; ++i)
  177. foo();
  178. #pragma omp master taskloop in_reduction(* : ca) // expected-error {{const-qualified variable cannot be in_reduction}}
  179. for (int i = 0; i < 10; ++i)
  180. foo();
  181. #pragma omp master taskloop in_reduction(- : da) // expected-error {{const-qualified variable cannot be in_reduction}} expected-error {{const-qualified variable cannot be in_reduction}}
  182. for (int i = 0; i < 10; ++i)
  183. foo();
  184. #pragma omp master taskloop in_reduction(^ : fl) // expected-error {{invalid operands to binary expression ('float' and 'float')}} expected-error {{in_reduction variable must appear in a task_reduction clause}}
  185. for (int i = 0; i < 10; ++i)
  186. foo();
  187. #pragma omp master taskloop in_reduction(&& : S2::S2s) // expected-error {{shared variable cannot be reduction}}
  188. for (int i = 0; i < 10; ++i)
  189. foo();
  190. #pragma omp master taskloop in_reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be in_reduction}}
  191. for (int i = 0; i < 10; ++i)
  192. foo();
  193. #pragma omp taskgroup task_reduction(+:k)
  194. #pragma omp master taskloop in_reduction(+ : h, k) // expected-error {{threadprivate or thread local variable cannot be reduction}}
  195. for (int i = 0; i < 10; ++i)
  196. foo();
  197. #pragma omp master taskloop in_reduction(+ : o) // expected-error 2 {{no viable overloaded '='}}
  198. for (int i = 0; i < 10; ++i)
  199. foo();
  200. #pragma omp parallel private(k)
  201. #pragma omp master taskloop in_reduction(+ : p), in_reduction(+ : p) // expected-error 2 {{argument of OpenMP clause 'in_reduction' must reference the same object in all threads}}
  202. for (int i = 0; i < 10; ++i)
  203. foo();
  204. #pragma omp taskgroup task_reduction(+:p)
  205. #pragma omp master taskloop in_reduction(+ : p), in_reduction(+ : p) // expected-error 2 {{variable can appear only once in OpenMP 'in_reduction' clause}} expected-note 2 {{previously referenced here}}
  206. for (int i = 0; i < 10; ++i)
  207. foo();
  208. #pragma omp master taskloop in_reduction(+ : r) // expected-error 2 {{const-qualified variable cannot be in_reduction}}
  209. for (int i = 0; i < 10; ++i)
  210. foo();
  211. #pragma omp parallel shared(i)
  212. #pragma omp parallel reduction(min : i)
  213. #pragma omp master taskloop in_reduction(max : j) // expected-error 2 {{argument of OpenMP clause 'in_reduction' must reference the same object in all threads}}
  214. for (int i = 0; i < 10; ++i)
  215. foo();
  216. #pragma omp taskgroup task_reduction(+:fl)
  217. {
  218. #pragma omp master taskloop in_reduction(+ : fl) allocate(omp_thread_mem_alloc: fl) // expected-warning 2 {{allocator with the 'thread' trait access has unspecified behavior on 'master taskloop' directive}}
  219. for (int i = 0; i < 10; ++i)
  220. foo();
  221. #pragma omp taskgroup task_reduction(*:fl) // expected-note 2 {{previously marked as task_reduction with different reduction operation}}
  222. {
  223. #pragma omp master taskloop in_reduction(+ : fl) // expected-error 2 {{in_reduction variable must have the same reduction operation as in a task_reduction clause}}
  224. for (int i = 0; i < 10; ++i)
  225. foo();
  226. }
  227. }
  228. #pragma omp parallel
  229. #pragma omp for reduction(- : fl)
  230. for (int i = 0; i < 10; ++i)
  231. #pragma omp taskgroup task_reduction(+:fl)
  232. #pragma omp master taskloop in_reduction(+ : fl)
  233. for (int j = 0; j < 10; ++j)
  234. foo();
  235. return T();
  236. }
  237. namespace A {
  238. double x;
  239. #pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
  240. }
  241. namespace B {
  242. using A::x;
  243. }
  244. int main(int argc, char **argv) {
  245. const int d = 5; // expected-note 2 {{'d' defined here}}
  246. const int da[5] = {0}; // expected-note {{'da' defined here}}
  247. int qa[5] = {0};
  248. S4 e(4);
  249. S5 g(5);
  250. int i;
  251. int &j = i; // expected-note {{'j' defined here}}
  252. S3 &p = k; // expected-note 2 {{'p' defined here}}
  253. const int &r = da[i]; // expected-note {{'r' defined here}}
  254. int &q = qa[i];
  255. float fl;
  256. #pragma omp master taskloop in_reduction // expected-error {{expected '(' after 'in_reduction'}}
  257. for (int i = 0; i < 10; ++i)
  258. foo();
  259. #pragma omp master taskloop in_reduction + // expected-error {{expected '(' after 'in_reduction'}} expected-warning {{extra tokens at the end of '#pragma omp master taskloop' are ignored}}
  260. for (int i = 0; i < 10; ++i)
  261. foo();
  262. #pragma omp master taskloop in_reduction( // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  263. for (int i = 0; i < 10; ++i)
  264. foo();
  265. #pragma omp master taskloop in_reduction(- // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  266. for (int i = 0; i < 10; ++i)
  267. foo();
  268. #pragma omp master taskloop in_reduction() // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
  269. for (int i = 0; i < 10; ++i)
  270. foo();
  271. #pragma omp master taskloop in_reduction(*) // expected-warning {{missing ':' after reduction identifier - ignoring}}
  272. for (int i = 0; i < 10; ++i)
  273. foo();
  274. #pragma omp master taskloop in_reduction(\) // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
  275. for (int i = 0; i < 10; ++i)
  276. foo();
  277. #pragma omp master taskloop in_reduction(foo : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max'}}
  278. for (int i = 0; i < 10; ++i)
  279. foo();
  280. #pragma omp taskgroup task_reduction(|:argc)
  281. #pragma omp master taskloop in_reduction(| : argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  282. for (int i = 0; i < 10; ++i)
  283. foo();
  284. #pragma omp master taskloop in_reduction(|| : argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name, array element or array section}}
  285. for (int i = 0; i < 10; ++i)
  286. foo();
  287. #pragma omp master taskloop in_reduction(~ : argc) // expected-error {{expected unqualified-id}}
  288. for (int i = 0; i < 10; ++i)
  289. foo();
  290. #pragma omp taskgroup task_reduction(&&:argc)
  291. #pragma omp master taskloop in_reduction(&& : argc)
  292. for (int i = 0; i < 10; ++i)
  293. foo();
  294. #pragma omp master taskloop in_reduction(^ : S1) // expected-error {{'S1' does not refer to a value}}
  295. for (int i = 0; i < 10; ++i)
  296. foo();
  297. #pragma omp taskgroup task_reduction(+:c)
  298. #pragma omp master taskloop in_reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{const-qualified variable cannot be in_reduction}} expected-error {{'operator+' is a private member of 'S2'}} expected-error {{in_reduction variable must appear in a task_reduction clause}}
  299. for (int i = 0; i < 10; ++i)
  300. foo();
  301. #pragma omp master taskloop in_reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{arguments of OpenMP clause 'in_reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 2 {{const-qualified variable cannot be in_reduction}}
  302. for (int i = 0; i < 10; ++i)
  303. foo();
  304. #pragma omp master taskloop in_reduction(max : h.b) // expected-error {{expected variable name, array element or array section}}
  305. for (int i = 0; i < 10; ++i)
  306. foo();
  307. #pragma omp master taskloop in_reduction(+ : ba) // expected-error {{const-qualified variable cannot be in_reduction}}
  308. for (int i = 0; i < 10; ++i)
  309. foo();
  310. #pragma omp master taskloop in_reduction(* : ca) // expected-error {{const-qualified variable cannot be in_reduction}}
  311. for (int i = 0; i < 10; ++i)
  312. foo();
  313. #pragma omp master taskloop in_reduction(- : da) // expected-error {{const-qualified variable cannot be in_reduction}}
  314. for (int i = 0; i < 10; ++i)
  315. foo();
  316. #pragma omp master taskloop in_reduction(^ : fl) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
  317. for (int i = 0; i < 10; ++i)
  318. foo();
  319. #pragma omp master taskloop in_reduction(&& : S2::S2s) // expected-error {{shared variable cannot be reduction}}
  320. for (int i = 0; i < 10; ++i)
  321. foo();
  322. #pragma omp master taskloop in_reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be in_reduction}}
  323. for (int i = 0; i < 10; ++i)
  324. foo();
  325. #pragma omp master taskloop in_reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{nvalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}}
  326. for (int i = 0; i < 10; ++i)
  327. foo();
  328. #pragma omp taskgroup task_reduction(+:k)
  329. #pragma omp master taskloop in_reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}}
  330. for (int i = 0; i < 10; ++i)
  331. foo();
  332. #pragma omp master taskloop in_reduction(+ : o) // expected-error {{no viable overloaded '='}}
  333. for (int i = 0; i < 10; ++i)
  334. foo();
  335. #pragma omp parallel private(k)
  336. #pragma omp master taskloop in_reduction(+ : p), in_reduction(+ : p) // expected-error 2 {{argument of OpenMP clause 'in_reduction' must reference the same object in all threads}}
  337. for (int i = 0; i < 10; ++i)
  338. foo();
  339. #pragma omp taskgroup task_reduction(+:p)
  340. #pragma omp master taskloop in_reduction(+ : p), in_reduction(+ : p) // expected-error {{variable can appear only once in OpenMP 'in_reduction' clause}} expected-note {{previously referenced here}}
  341. for (int i = 0; i < 10; ++i)
  342. foo();
  343. #pragma omp master taskloop in_reduction(+ : r) // expected-error {{const-qualified variable cannot be in_reduction}}
  344. for (int i = 0; i < 10; ++i)
  345. foo();
  346. #pragma omp parallel shared(i)
  347. #pragma omp parallel reduction(min : i)
  348. #pragma omp master taskloop in_reduction(max : j) // expected-error {{argument of OpenMP clause 'in_reduction' must reference the same object in all threads}}
  349. for (int i = 0; i < 10; ++i)
  350. foo();
  351. #pragma omp parallel
  352. #pragma omp for private(fl)
  353. for (int i = 0; i < 10; ++i)
  354. #pragma omp taskgroup task_reduction(+:fl)
  355. #pragma omp master taskloop in_reduction(+ : fl)
  356. for (int j = 0; j < 10; ++j)
  357. foo();
  358. #pragma omp taskgroup task_reduction(+:fl)
  359. #pragma omp master taskloop in_reduction(+ : fl)
  360. for (int i = 0; i < 10; ++i)
  361. foo();
  362. static int m;
  363. #pragma omp taskgroup task_reduction(+:m)
  364. #pragma omp master taskloop in_reduction(+ : m) // OK
  365. for (int i = 0; i < 10; ++i)
  366. m++;
  367. return tmain(argc) + tmain(fl); // expected-note {{in instantiation of function template specialization 'tmain<int>' requested here}} expected-note {{in instantiation of function template specialization 'tmain<float>' requested here}}
  368. }