gcc/testsuite/g++.dg/cpp0x/nsdmi-list5.C
raw| 1 | // PR c++/85552 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | template<typename T> |
| 5 | struct uptr { |
| 6 | uptr() { } |
| 7 | uptr(void*) { } |
| 8 | ~uptr() { static_assert(sizeof(T), "complete type"); } |
| 9 | }; |
| 10 | |
| 11 | class S; |
| 12 | |
| 13 | class Compiles |
| 14 | { |
| 15 | uptr<S> s; |
| 16 | }; |
| 17 | |
| 18 | class DoesntCompile |
| 19 | { |
| 20 | ~DoesntCompile(); |
| 21 | DoesntCompile(); |
| 22 | |
| 23 | uptr<S> s1 { }; |
| 24 | uptr<S> s2 { nullptr }; |
| 25 | }; |
| 26 | |
| 27 | int main() |
| 28 | { |
| 29 | return 0; |
| 30 | } |