1 // PR c++/37533 2 // { dg-do compile } 3 // { dg-options "-fopenmp" } 4 5 template<int> 6 void f1()7f1 () 8 { 9 #pragma omp parallel for 10 for (int i = ""; i < 4; ++i) // { dg-error "invalid conversion from" } 11 ; 12 } 13 14 template<int> 15 void f2()16f2 () 17 { 18 int i; 19 #pragma omp parallel for 20 for (i = ""; i < 4; ++i) // { dg-error "invalid conversion from" } 21 ; 22 } 23 24 template<typename T> 25 void f3()26f3 () 27 { 28 #pragma omp parallel for 29 for (T i = ""; i < 4; ++i) // { dg-error "invalid conversion from" } 30 ; 31 } 32 33 template<typename T> 34 void f4()35f4 () 36 { 37 T i; 38 #pragma omp parallel for 39 for (i = ""; i < 4; ++i) // { dg-error "invalid conversion from" } 40 ; 41 } 42 43 void bar()44bar () 45 { 46 f1<0> (); // { dg-message "required from here" } 47 f2<1> (); // { dg-message "required from here" } 48 f3<int> (); // { dg-message "required from here" } 49 f4<int> (); // { dg-message "required from here" } 50 } 51