typedef __PTRDIFF_TYPE__ ptrdiff_t; template class I { public: typedef ptrdiff_t difference_type; I (); ~I (); I (T *); I (const I &); T &operator * (); T *operator -> (); T &operator [] (const difference_type &) const; I &operator = (const I &); I &operator ++ (); I operator ++ (int); I &operator -- (); I operator -- (int); I &operator += (const difference_type &); I &operator -= (const difference_type &); I operator + (const difference_type &) const; I operator - (const difference_type &) const; template friend bool operator == (I &, I &); template friend bool operator == (const I &, const I &); template friend bool operator < (I &, I &); template friend bool operator < (const I &, const I &); template friend bool operator <= (I &, I &); template friend bool operator <= (const I &, const I &); template friend bool operator > (I &, I &); template friend bool operator > (const I &, const I &); template friend bool operator >= (I &, I &); template friend bool operator >= (const I &, const I &); template friend typename I::difference_type operator - (I &, I &); template friend typename I::difference_type operator - (const I &, const I &); template friend I operator + (typename I::difference_type , const I &); private: T *p; }; template bool operator == (I &, I &); template bool operator == (const I &, const I &); template bool operator != (I &, I &); template bool operator != (const I &, const I &); template bool operator < (I &, I &); template bool operator < (const I &, const I &); template bool operator <= (I &, I &); template bool operator <= (const I &, const I &); template bool operator > (I &, I &); template bool operator > (const I &, const I &); template bool operator >= (I &, I &); template bool operator >= (const I &, const I &); template typename I::difference_type operator - (I &, I &); template typename I::difference_type operator - (const I &, const I &); template I operator + (typename I::difference_type, const I &); extern I i, j; #pragma omp threadprivate (i, j) extern I k, l; #pragma omp threadprivate (k, l) I k, l; void f1 (I &x, I &y) { #pragma omp for collapse(2) for (i = x; i < y; i++) // { dg-error "expected iteration declaration or initialization" } for (j = x; j < y; j++) ; } void f2 (I &x, I &y) { #pragma omp for collapse(2) for (k = x; k < y; k++) // { dg-error "expected iteration declaration or initialization" } for (l = x; l < y; l++) ; } template void f3 (I &x, I &y) { #pragma omp for collapse(2) for (i = x; i < y; i++) // { dg-error "'i' is predetermined 'threadprivate' for 'private'" } for (j = x; j < y; j++) // { dg-error "'j' is predetermined 'threadprivate' for 'private'" } ; } template void f4 (I &x, I &y) { #pragma omp for collapse(2) for (k = x; k < y; k++) // { dg-error "'k' is predetermined 'threadprivate' for 'private'" } for (l = x; l < y; l++) // { dg-error "'l' is predetermined 'threadprivate' for 'private'" } ; } template void f5 (I &x, I &y) { #pragma omp for collapse(2) // { dg-error "expected iteration declaration or initialization" } for (i = x; i < y; i++) // { dg-error "'i' is predetermined 'threadprivate' for 'private'" } for (j = x; j < y; j++) // { dg-error "'j' is predetermined 'threadprivate' for 'private'" } ; } template void f6 (I &x, I &y) { #pragma omp for collapse(2) // { dg-error "expected iteration declaration or initialization" } for (k = x; k < y; k++) // { dg-error "'k' is predetermined 'threadprivate' for 'private'" } for (l = x; l < y; l++) // { dg-error "'l' is predetermined 'threadprivate' for 'private'" } ; } void test (I &x, I &y) { f3<0> (x, y); f4<0> (x, y); f5 (x, y); f6 (x, y); }