This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3 PATCH] PR libstdc++/80165


This just adds a missing test. The bug was in variant, not tuple,
so I added the test under variant. Ok for trunk (this is not going
to be backported)?

2018-05-12  Ville Voutilainen  <ville.voutilainen@gmail.com>

    PR libstdc++/80165
    * testsuite/20_util/variant/80165.cc: New.
diff --git a/libstdc++-v3/testsuite/20_util/variant/80165.cc b/libstdc++-v3/testsuite/20_util/variant/80165.cc
new file mode 100644
index 0000000..add976c
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/variant/80165.cc
@@ -0,0 +1,12 @@
+// { dg-options "-std=gnu++17" }
+// { dg-do compile { target c++17 } }
+
+#include <tuple>
+#include <variant>
+
+int main() {
+  using variant_t = std::variant<short, int, long>;
+  constexpr auto variant_v = variant_t{std::in_place_index_t<0>{}, short{}};
+  constexpr auto tuple = std::make_tuple(variant_v);
+  constexpr std::tuple tuple_v{variant_v};
+}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]