From 365bc037d67220dae412b45281f04a96140168da Mon Sep 17 00:00:00 2001 From: Matt Beaumont-Gay Date: Tue, 12 Mar 2013 23:56:16 +0000 Subject: [PATCH] Test for LLVM r176911 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176912 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Misc/diagnostic-crash.cpp | 39 ++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 test/Misc/diagnostic-crash.cpp diff --git a/test/Misc/diagnostic-crash.cpp b/test/Misc/diagnostic-crash.cpp new file mode 100644 index 0000000000..cbb9ac60dd --- /dev/null +++ b/test/Misc/diagnostic-crash.cpp @@ -0,0 +1,39 @@ +// RUN: %clang_cc1 -verify -fsyntax-only %s +// The diagnostics we produce for this code tickled a bug in raw_ostream. +template class allocator; +template struct char_traits; +template , + typename _Alloc = allocator<_CharT> > +class basic_string; +typedef basic_string wstring; +class Closure { +}; +template class Callback1 { +}; +template class Callback2 { +}; +template class ResultCallback1 { +}; +template +class AAAAAAAResultCallback_2_1 : public ResultCallback1 { +}; +template +class AAAAAAAResultCallback_2_1< del, void, T, P1, P2, A1> : + public Callback1 { + public: + typedef Callback1 base; +}; +template +inline typename AAAAAAAResultCallback_2_1::base* +NewCallback(T1* obj, R(T2::* member)(P1, P2, A1), const P1& p1, const P2& p2) {} +namespace util { class Status {}; } +class xxxxxxxxxxxxxxxxx { + void Bar(wstring* s, util::Status* status, + Callback2* done); + void Foo(); +}; +void xxxxxxxxxxxxxxxxx::Foo() { + wstring* s = __null; + util::Status* status = __null; + Closure* cb = NewCallback(this, &xxxxxxxxxxxxxxxxx::Bar, s, status); // expected-error{{cannot initialize}} +} -- 2.50.0