Add a test case for the stack overflow in rdar://12542261

llvm-svn: 166858
This commit is contained in:
Argyrios Kyrtzidis 2012-10-27 02:13:28 +00:00
parent 21fd13f9b7
commit 668bf82658
1 changed files with 26 additions and 0 deletions

View File

@ -36,3 +36,29 @@ S4 foo2() {
}
}
// rdar://12542261 stack overflow.
namespace rdar12542261 {
template <class _Tp>
struct check_complete
{
static_assert(sizeof(_Tp) > 0, "Type must be complete.");
};
template<class _Rp>
class function // expected-note 2 {{candidate}}
{
public:
template<class _Fp>
function(_Fp, typename check_complete<_Fp>::type* = 0); // expected-note {{candidate}}
};
void foobar()
{
auto LeftCanvas = new Canvas(); // expected-error {{unknown type name}}
function<void()> m_OnChange = [&, LeftCanvas]() { }; // expected-error {{no viable conversion}}
}
}