Fix improperly failing test - and the code it was testing. Thanks to Stephan Lavavej for the catch.

llvm-svn: 328225
This commit is contained in:
Marshall Clow 2018-03-22 18:27:28 +00:00
parent 1193c370b4
commit a4122be549
2 changed files with 5 additions and 6 deletions

View File

@ -1071,19 +1071,17 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p)
return __os << __p.get();
}
#ifndef _LIBCPP_HAS_NO_DECLTYPE
template<class _CharT, class _Traits, class _Yp, class _Dp>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
is_same<void, typename __void_t<decltype(declval<basic_ostream<_CharT, _Traits>&>() << declval<_Yp>())>::type>::value,
is_same<void, typename __void_t<decltype((declval<basic_ostream<_CharT, _Traits>&>() << declval<typename unique_ptr<_Yp, _Dp>::pointer>()))>::type>::value,
basic_ostream<_CharT, _Traits>&
>::type
operator<<(basic_ostream<_CharT, _Traits>& __os, unique_ptr<_Yp, _Dp> const& __p)
{
return __os << __p.get();
}
#endif
template <class _CharT, class _Traits, size_t _Size>
basic_ostream<_CharT, _Traits>&

View File

@ -24,11 +24,12 @@
#include <sstream>
#include <cassert>
class A {};
#include "min_allocator.h"
#include "deleter_types.h"
int main()
{
std::unique_ptr<A> p(new A);
std::unique_ptr<int, PointerDeleter<int>> p;
std::ostringstream os;
os << p;
os << p; // expected-error {{invalid operands to binary expression}}
}