mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-29 21:24:04 +00:00
Add a missing '__uncvref_t' to the SFINAE constraints for optional's assignment operator. Fixes PR38638. Thanks to Jonathan Wakely for the report
llvm-svn: 364574
This commit is contained in:
parent
2dcd2c2493
commit
954014a0fa
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user