gcc/testsuite/g++.dg/cpp0x/static_assert4.C
raw| 1 | // { dg-do compile { target c++11 } } |
| 2 | // { dg-options "--param ggc-min-heapsize=0 --param ggc-min-expand=0 " } |
| 3 | // PR C++/30033 |
| 4 | // Make sure that the static assert does not crash the GC. |
| 5 | |
| 6 | template <class T> |
| 7 | struct default_delete |
| 8 | { |
| 9 | void |
| 10 | operator() (T * ptr) const |
| 11 | { |
| 12 | static_assert (sizeof (T) > 0, "Can't delete pointer to incomplete type"); |
| 13 | } |
| 14 | }; |
| 15 | |
| 16 |