Debian Codegraph @

gcc/testsuite/g++.dg/ext/vla4.C

raw
1 // PR c++/29318
2 // Explicit { dg-require-effective-target exceptions_enabled } to avoid verify compiler messages FAILs for '-fno-exceptions'.
3 // { dg-options "" }
4
5 #include <typeinfo>
6
7 void f(int i) {
8 try {
9 int a[i];
10 throw &a; // { dg-error "11:cannot throw expression of type .int \\(\\*\\)\\\[i\\\]." }
11 } catch (int (*)[i]) { // { dg-error "variable size" }
12 }
13 }
14
15 int main()
16 {
17 int i = 5;
18 int va[i];
19 const std::type_info& info(typeid(&va)); // { dg-error "variable size" }
20
21 return 0;
22 }