|
@@ -9,7 +9,10 @@
|
|
|
|
|
|
// <optional>
|
|
|
// UNSUPPORTED: c++98, c++03, c++11, c++14
|
|
|
+// UNSUPPORTED: clang-5
|
|
|
// UNSUPPORTED: libcpp-no-deduction-guides
|
|
|
+// Clang 5 will generate bad implicit deduction guides
|
|
|
+// Specifically, for the copy constructor.
|
|
|
|
|
|
|
|
|
// template<class T>
|
|
@@ -40,18 +43,12 @@ int main()
|
|
|
}
|
|
|
|
|
|
// Test the implicit deduction guides
|
|
|
-
|
|
|
{
|
|
|
-// optional(const optional &);
|
|
|
- // FIXME clang and GCC disagree about this!
|
|
|
- // clang thinks opt is optional<optional<char>>, GCC thinks it's optional<char>.
|
|
|
-#if 0
|
|
|
+// optional(optional);
|
|
|
std::optional<char> source('A');
|
|
|
std::optional opt(source);
|
|
|
- static_assert(std::is_same_v<decltype(opt), std::optional<std::optional<char>>>, "");
|
|
|
+ static_assert(std::is_same_v<decltype(opt), std::optional<char>>, "");
|
|
|
assert(static_cast<bool>(opt) == static_cast<bool>(source));
|
|
|
assert(*opt == *source);
|
|
|
-#endif
|
|
|
}
|
|
|
-
|
|
|
}
|