aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/gomp/pr92504.C
blob: 8df67621532b95e1858b00b61cee7de72b54fb14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// PR c++/92504
// { dg-do compile { target c++11 } }
// { dg-additional-options "-O2" }

namespace std {
  typedef __SIZE_TYPE__ size_t;
  typedef __PTRDIFF_TYPE__ ptrdiff_t;
}

struct A {
  A ();
  A (const A &);
  A & operator++ ();
  bool operator != (const A &) const;
  std::ptrdiff_t operator - (const A &);
  A & operator += (std::size_t);
  int a;
  A & begin ();
  A & end ();				// { dg-message "declared here" }
};

void
bar ()
{
  A a;
  #pragma omp for
  for (auto b = a; b != a.end; ++b)	// { dg-error "invalid use of non-static member function" }
    ;
}