Debian Codegraph @

gcc/testsuite/g++.dg/cpp1y/vla5.C

raw
1 // PR c++/55149
2 // { dg-do compile { target c++11 } }
3 // { dg-options "-Wno-vla" }
4
5 void test(int n) {
6 int r[n];
7 [&r]() { return r + 0; };
8 [r]() { return r + 0; }; // { dg-error "captured by copy" }
9 }