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
diff --git a/test/std/utilities/variant/variant.variant/variant.ctor/T.pass.cpp b/test/std/utilities/variant/variant.variant/variant.ctor/T.pass.cpp
index ef07482..d05e800 100644
--- a/test/std/utilities/variant/variant.variant/variant.ctor/T.pass.cpp
+++ b/test/std/utilities/variant/variant.variant/variant.ctor/T.pass.cpp
@@ -177,13 +177,13 @@
#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);