git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@364574 91177308-0d34-0410-b5e6-96231b3b80d8
@@ -773,7 +773,7 @@ public:
_And<
_IsNotSame<__uncvref_t<_Up>, optional>,
_Or<
- _IsNotSame<_Up, value_type>,
+ _IsNotSame<__uncvref_t<_Up>, value_type>,
_Not<is_scalar<value_type>>
>,
is_constructible<value_type, _Up>,
@@ -241,6 +241,16 @@ enum MyEnum { Zero, One, Two, Three, FortyTwo = 42 };
using Fn = void(*)();
+// https://bugs.llvm.org/show_bug.cgi?id=38638
+template <class T>
+constexpr T pr38638(T v)
+{
+ std::optional<T> o;
+ o = v;
+ return *o + 2;
+}
+
int main(int, char**)
{
test_sfinae();
@@ -269,5 +279,7 @@ int main(int, char**)
}
test_throws();
+ static_assert(pr38638(3) == 5, "");
return 0;