summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/gomp/pr35078.C
blob: 1f0d9ec7f3c246ed36216421ac8d88dd92cc611a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// PR c++/35078
// { dg-do compile }
// { dg-options "-fopenmp" }

template<int> void
foo ()
{
#pragma omp parallel for
  for (int& i = 0; i < 10; ++i)	// { dg-error "invalid type for iteration variable" }
    ;
}

void
bar ()
{
  int j = 0;
#pragma omp parallel for
  for (int& i = j; i < 10; ++i)	// { dg-error "invalid type for iteration variable" }
    ;
}