2 // { dg-options "-Wall" }
4 // Test for c++/68308 - [6 Regression] ICE: tree check: expected integer_cst,
5 // have var_decl in decompose, at tree.h:5105
7 typedef __typeof__ (sizeof 0) size_t;
9 // Not defined, only referenced in templates that aren't expected
10 // to be instantiated to make sure they really aren't to verify
12 template <class T> void inst_check ();
14 // Not instantiated (must not be diagnosed).
17 const size_t a = sizeof (T);
18 return inst_check<T>() ? new char [a] : 0;
21 // Not instantiated (must not be diagnosed).
24 return inst_check<char [N]>() ? new char [N] : 0;
32 // Not instantiated (must not be diagnosed).
33 template <size_t M, size_t N>
35 return inst_check<char [M][N]>() ? new char [M][N] : 0;
38 template <size_t M, size_t N>
40 return new char [M][N]; // { dg-error "size of array is too large" }
43 // Not instantiated (must not be diagnosed).
46 const size_t a = sizeof (T);
47 return inst_check<T>() ? new T [a] : 0;
52 const size_t a = sizeof (T);
53 return new T [a]; // { dg-error "size of array is too large" }
57 struct S { char a [__SIZE_MAX__ / 8]; };
62 fn2_1<__SIZE_MAX__ / 4>();
63 fn2_2<__SIZE_MAX__ / 4, 4>();