Harden variant test added in r366022

The test was brittle since it only went boom for one specific type, when
really it should go boom for all of them.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@366025 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2019-07-14 18:30:34 +00:00
parent 301501fb78
commit d13b2c9c44
@@ -177,13 +177,13 @@ void test_T_ctor_basic() {
#endif
}
struct BoomOnInt {
struct BoomOnAnything {
template <class T>
constexpr BoomOnInt(T) { static_assert(!std::is_same<T, int>::value, ""); }
constexpr BoomOnAnything(T) { static_assert(!std::is_same<T, T>::value, ""); }
};
void test_no_narrowing_check_for_class_types() {
using V = std::variant<int, BoomOnInt>;
using V = std::variant<int, BoomOnAnything>;
V v(42);
assert(v.index() == 0);
assert(std::get<0>(v) == 42);