1 // Test that array capture by copy works. 2 // { dg-do run { target c++11 } } 3 4 struct A 5 { 6 int i; AA7 A(int i): i(i) {} AA8 A(const A& a): i(a.i+1) {} 9 }; 10 main()11int main() 12 { 13 A ar[4][3] = { { 10, 20, 30 }, 14 { 40, 50, 60 }, 15 { 70, 80, 90 }, 16 { 100, 110, 120 } }; 17 int i = [ar] { return ar[1][1]; }().i; 18 return (i!= 52); 19 } 20