diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/static_assert4.C')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/static_assert4.C | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/static_assert4.C b/gcc/testsuite/g++.dg/cpp0x/static_assert4.C new file mode 100644 index 000000000..b0818873f --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/static_assert4.C @@ -0,0 +1,15 @@ +// { dg-options "-std=c++0x --param ggc-min-heapsize=0 --param ggc-min-expand=0 " } +// PR C++/30033 +// Make sure that the static assert does not crash the GC. + +template <class T> +struct default_delete +{ + void + operator() (T * ptr) const + { + static_assert (sizeof (T) > 0, "Can't delete pointer to incomplete type"); + } +}; + + |