summaryrefslogtreecommitdiffstats
path: root/libcxx/include
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-10-16 03:21:35 +0000
committerEric Fiselier <eric@efcs.ca>2016-10-16 03:21:35 +0000
commit015fcffd57fb71fa29d307ac54b8626c8088b856 (patch)
tree4ffc8d764b5835c6045967064c23274e12e8db27 /libcxx/include
parent50253ed1c67b75c71c8ec2d24ed915c032b11822 (diff)
downloadbcm5719-llvm-015fcffd57fb71fa29d307ac54b8626c8088b856.tar.gz
bcm5719-llvm-015fcffd57fb71fa29d307ac54b8626c8088b856.zip
Update status for std::optional LWG issues and fix an optional SFINAE bug
llvm-svn: 284323
Diffstat (limited to 'libcxx/include')
-rw-r--r--libcxx/include/experimental/optional4
-rw-r--r--libcxx/include/optional14
2 files changed, 12 insertions, 6 deletions
diff --git a/libcxx/include/experimental/optional b/libcxx/include/experimental/optional
index 966c889e99d..ebe11e6b934 100644
--- a/libcxx/include/experimental/optional
+++ b/libcxx/include/experimental/optional
@@ -487,7 +487,11 @@ public:
operator->() const
{
_LIBCPP_ASSERT(this->__engaged_, "optional operator-> called for disengaged value");
+#ifndef _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
+ return _VSTD::addressof(this->__val_);
+#else
return __operator_arrow(__has_operator_addressof<value_type>{});
+#endif
}
_LIBCPP_INLINE_VISIBILITY
diff --git a/libcxx/include/optional b/libcxx/include/optional
index 46252c7e0e0..c64aa8f7f72 100644
--- a/libcxx/include/optional
+++ b/libcxx/include/optional
@@ -681,12 +681,14 @@ public:
// LWG2756
template <class _Up = value_type,
class = enable_if_t
- <
- !is_same_v<_Up, optional> &&
- !(is_same_v<_Up, value_type> && is_scalar_v<value_type>) &&
- is_constructible_v<value_type, _Up> &&
- is_assignable_v<value_type&, _Up>
- >
+ <__lazy_and<
+ integral_constant<bool,
+ !is_same_v<decay_t<_Up>, optional> &&
+ !(is_same_v<_Up, value_type> && is_scalar_v<value_type>)
+ >,
+ is_constructible<value_type, _Up>,
+ is_assignable<value_type&, _Up>
+ >::value>
>
_LIBCPP_INLINE_VISIBILITY
optional&
OpenPOWER on IntegriCloud