[cfe-commits] r166858 - /cfe/trunk/test/SemaCXX/cxx11-crashes.cpp

Argyrios Kyrtzidis akyrtzi at gmail.com
Fri Oct 26 19:13:28 PDT 2012


Author: akirtzidis
Date: Fri Oct 26 21:13:28 2012
New Revision: 166858

URL: http://llvm.org/viewvc/llvm-project?rev=166858&view=rev
Log:
Add a test case for the stack overflow in rdar://12542261

Modified:
    cfe/trunk/test/SemaCXX/cxx11-crashes.cpp

Modified: cfe/trunk/test/SemaCXX/cxx11-crashes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/cxx11-crashes.cpp?rev=166858&r1=166857&r2=166858&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/cxx11-crashes.cpp (original)
+++ cfe/trunk/test/SemaCXX/cxx11-crashes.cpp Fri Oct 26 21:13:28 2012
@@ -36,3 +36,29 @@
 }
 
 }
+
+// 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}}
+}
+
+}





More information about the cfe-commits mailing list