1 // { dg-do run { target c++11 } }
2 // PR rtl-optimization/95493 comment 8
9 std::array<int, 3> array;
11 Point(int x, int y, int z) : array{x, y, z} {}
13 Point(const Point & other) : array{other.array} {} // OK if commented
14 //Point(const Point &) = default; // OK
16 //Point(Point && other) = default; // OK
18 int operator[] (std::size_t i) const { return array[i]; }
19 int& operator[] (std::size_t i) { return array[i]; }
22 //using Point = std::array<int, 3>; // OK
27 Cell(Point const& pt) : point(pt) {}
28 int operator[] (std::size_t i) const { return point[i]; }
29 int& operator[] (std::size_t i) { return point[i]; }
32 //using Cell = Point; // OK
34 std::ostream & operator<< (std::ostream & out, Cell const& object)
35 //std::ostream & operator<< (std::ostream & out, Cell object) // Fails with f2 too
37 for ( std::size_t i = 0; i < 3; ++i )
38 out << object[ i ] << " ";
51 find(); // OK if commented
56 //while (dir < 3) // Fails with f2 too
57 while (dir < 3 && (cell[dir] % 2) == 0)
62 Cell uIncident(Cell c, std::size_t k)
63 //Cell uIncident(Cell& c, std::size_t k) // OK
71 for (std::size_t i = 0; i < 3; ++i)
79 Cell c = uSpel(Point{0, 0, 0}); // Fails
80 //Cell c( Point(1, 1, 1) ); // OK
82 auto q = DirIterator( c );
84 Cell f1 = uIncident( c, q.dir ); // Fails
85 //Cell f1 = uIncident( c, 0 ); // OK
87 Cell f2 = f1; // f2 is the right cell that f1 should be
89 std::cout << "q.dir = " << q.dir << " ; f1 = " << f1 << " ; f2 = " << f2 << std::endl;
90 //std::cout << "q.dir = " << q.dir << " ; f1 = " << f1[0] << " " << f1[1] << " " << f1[2] << " ; f2 = " << f2[0] << " " << f2[1] << " " << f2[2] << std::endl; // OK
92 for (int i = 0; i < 3; ++i)