This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[v3 PATCH] PR libstdc++/80165
- From: Ville Voutilainen <ville dot voutilainen at gmail dot com>
- To: gcc-patches List <gcc-patches at gcc dot gnu dot org>, "libstdc++" <libstdc++ at gcc dot gnu dot org>
- Date: Sat, 12 May 2018 20:37:21 +0300
- Subject: [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};
+}