]> granicus.if.org Git - clang/commitdiff
Add a test case for the stack overflow in rdar://12542261
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 27 Oct 2012 02:13:28 +0000 (02:13 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sat, 27 Oct 2012 02:13:28 +0000 (02:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166858 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaCXX/cxx11-crashes.cpp

index d5db10962f94d1a36696a87956f92aa6b5c26c92..66b182bf7be0c40d66b9a20c34fcb23152aecad9 100644 (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}}
+}
+
+}