Message ID | CAFk2RUbR2oiFPtqMBTaamLZj5zjuPHtWQEzUB7Oj2Q-Ej=G6Ng@mail.gmail.com |
---|---|
State | New |
Headers | show |
Series | [v3] PR libstdc++/80165 | expand |
On 12/05/18 20:37 +0300, Ville Voutilainen wrote: >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)? OK, thanks.
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}; +}