summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2018-03-22 18:27:28 +0000
committerMarshall Clow <mclow.lists@gmail.com>2018-03-22 18:27:28 +0000
commita4122be54964e88a9fee8c67406202de81d0d507 (patch)
tree76f4822738f7115875f50965d266c0debd0c2848
parent1193c370b4b2ba671e95ae4df20d79068e231398 (diff)
downloadbcm5719-llvm-a4122be54964e88a9fee8c67406202de81d0d507.tar.gz
bcm5719-llvm-a4122be54964e88a9fee8c67406202de81d0d507.zip
Fix improperly failing test - and the code it was testing. Thanks to Stephan Lavavej for the catch.
llvm-svn: 328225
-rw-r--r--libcxx/include/ostream4
-rw-r--r--libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.special/io.fail.cpp7
2 files changed, 5 insertions, 6 deletions
diff --git a/libcxx/include/ostream b/libcxx/include/ostream
index f3250a7080d..197636eac61 100644
--- a/libcxx/include/ostream
+++ b/libcxx/include/ostream
@@ -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>&
diff --git a/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.special/io.fail.cpp b/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.special/io.fail.cpp
index 48c90f7b966..54c85e94338 100644
--- a/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.special/io.fail.cpp
+++ b/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.special/io.fail.cpp
@@ -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}}
}
OpenPOWER on IntegriCloud