1 // PR c++/50391 2 // { dg-do compile { target c++11 } } 3 4 #include <type_traits> 5 6 template<class Tp> 7 struct single 8 { 9 Tp elem; // { dg-error "incomplete type" } 10 singlesingle11 constexpr single(const Tp& e) 12 : elem(e) { } 13 14 single(single&& s) noexceptsingle15 noexcept(std::is_nothrow_move_constructible<Tp>::value) 16 : elem(s.elem) { } 17 }; 18 19 template<class Tp> 20 constexpr single<typename std::decay<Tp>::type> make_single(Tp && x)21 make_single(Tp&& x) 22 { 23 return single<typename std::decay<Tp>::type>(x); 24 } 25 26 class Blob; // { dg-message "forward declaration" } 27 28 void foo(Blob * b)29foo(Blob *b) 30 { 31 make_single(*b); 32 } 33