Add test for variant construction with duplicate types.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@366032 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 d05e800..42a31f3 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
@@ -189,10 +189,22 @@
   assert(std::get<0>(v) == 42);
 }
 
+struct Bar {};
+struct Baz {};
+void test_construction_with_repeated_types() {
+  using V = std::variant<int, Bar, Baz, int, Baz, int, int>;
+  static_assert(!std::is_constructible<V, int>::value, "");
+  static_assert(!std::is_constructible<V, Baz>::value, "");
+  // OK, the selected type appears only once and so it shouldn't
+  // be affected by the duplicate types.
+  static_assert(std::is_constructible<V, Bar>::value, "");
+}
+
 int main(int, char**) {
   test_T_ctor_basic();
   test_T_ctor_noexcept();
   test_T_ctor_sfinae();
   test_no_narrowing_check_for_class_types();
+  test_construction_with_repeated_types();
   return 0;
 }