PR c++/53848
[official-gcc.git] / gcc / testsuite / g++.dg / other / pr35011.C
blobca75516d6e1f7513ade41a8e716c4f736ed22c91
1 // { dg-do compile }
2 // { dg-options "-O3 -fcheck-data-deps" }
4 double foo(const double* p0, const double* p1, const double* q0)
6   double d;
7   for (; p0 != p1; ++p0, ++q0)
8     d += *p0 * *q0;
9   return d;
12 struct A
14   double x[3];
15   const double* begin() const { return x; }
18 struct B
20   A a0, a1;
21   double d;
22   B(const A&);
25 B::B(const A& a) : a0(a), a1(a), d(foo(a0.begin(), a0.begin()+3, a1.begin()))