From: Argyrios Kyrtzidis Date: Sat, 27 Oct 2012 02:13:28 +0000 (+0000) Subject: Add a test case for the stack overflow in rdar://12542261 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b21c11d655027ae439be83af84f9bce3ab0f728b;p=clang Add a test case for the stack overflow in rdar://12542261 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166858 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/SemaCXX/cxx11-crashes.cpp b/test/SemaCXX/cxx11-crashes.cpp index d5db10962f..66b182bf7b 100644 --- a/test/SemaCXX/cxx11-crashes.cpp +++ b/test/SemaCXX/cxx11-crashes.cpp @@ -36,3 +36,29 @@ S4 foo2() { } } + +// rdar://12542261 stack overflow. +namespace rdar12542261 { + +template +struct check_complete +{ + static_assert(sizeof(_Tp) > 0, "Type must be complete."); +}; + + +template +class function // expected-note 2 {{candidate}} +{ +public: + template + function(_Fp, typename check_complete<_Fp>::type* = 0); // expected-note {{candidate}} +}; + +void foobar() +{ + auto LeftCanvas = new Canvas(); // expected-error {{unknown type name}} + function m_OnChange = [&, LeftCanvas]() { }; // expected-error {{no viable conversion}} +} + +}