gcc/testsuite/g++.dg/cpp0x/new6.C
raw| 1 | // PR c++/108218 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | template<class T> |
| 5 | void f() { |
| 6 | decltype(new int[-1]) p; // { dg-error "negative" } |
| 7 | decltype(new int[0-1]) q; // { dg-error "negative" } |
| 8 | decltype(new int[1*-1]) r; // { dg-error "negative" } |
| 9 | } |
| 10 | |
| 11 | decltype(new int[-1]) p; // { dg-error "negative" } |
| 12 | decltype(new int[0-1]) q; // { dg-error "negative" } |
| 13 | decltype(new int[1*-1]) r; // { dg-error "negative" } |