Daily bump.
[gcc.git] / gcc / testsuite / g++.dg / warn / Wrange-loop-construct3.C
blob3d9d0c9088e6c5c49e33ef9cd8090e6497b3d210
1 // PR c++/116731
2 // { dg-do compile { target c++11 } }
3 // { dg-options "-Wrange-loop-construct" }
5 void
6 f0 ()
8   struct S {
9     char a[64];
10     S& operator=(const S&) { return *this; };
11   };
13   S arr[8];
14   for (const auto r : arr)
15     (void) r;
18 void
19 f1 ()
21   struct S {
22     char a[65];
23     S& operator=(const S&) { return *this; };
24   };
26   S arr[8];
27   for (const auto r : arr) // { dg-warning "creates a copy" }
28     (void) r;
31 void
32 f2 ()
34   struct S {
35     char a[64];
36     S& operator=(const S&) { return *this; };
37     ~S() { }
38   };
40   S arr[8];
41   for (const auto r : arr) // { dg-warning "creates a copy" }
42     (void) r;
45 void
46 f3 ()
48   struct S {
49     char a[65];
50     S& operator=(const S&) { return *this; };
51     ~S() { }
52   };
54   S arr[8];
55   for (const auto r : arr) // { dg-warning "creates a copy" }
56     (void) r;