re PR libstdc++/80165 (Constexpr tuple of variant doesn't work)
authorVille Voutilainen <ville.voutilainen@gmail.com>
Sun, 13 May 2018 10:36:12 +0000 (13:36 +0300)
committerVille Voutilainen <ville@gcc.gnu.org>
Sun, 13 May 2018 10:36:12 +0000 (13:36 +0300)
PR libstdc++/80165
* testsuite/20_util/variant/80165.cc: New.

From-SVN: r260209

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/20_util/variant/80165.cc [new file with mode: 0644]

index 66b45931b93c00500830c7015602fd34da000523..f95630e8c5e0e98f13ca57a9725a63c40c53a437 100644 (file)
@@ -1,3 +1,8 @@
+2018-05-13  Ville Voutilainen  <ville.voutilainen@gmail.com>
+
+       PR libstdc++/80165
+       * testsuite/20_util/variant/80165.cc: New.
+
 2018-05-10  Jonathan Wakely  <jwakely@redhat.com>
 
        * doc/xml/faq.xml: Link to C++17 status. Add note to outdated answer.
diff --git a/libstdc++-v3/testsuite/20_util/variant/80165.cc b/libstdc++-v3/testsuite/20_util/variant/80165.cc
new file mode 100644 (file)
index 0000000..add976c
--- /dev/null
@@ -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};
+}