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:
Marshall Clow
2019-06-27 18:40:55 +00:00
parent 2dcd2c2493
commit 954014a0fa
2 changed files with 13 additions and 1 deletions

View File

@@ -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;
}