|
Boost : |
Subject: [boost] [variant] gcc crash
From: Igor R (boost.lists_at_[hidden])
Date: 2016-12-17 15:57:36
Consider the following snippet (trying to compile with Boost 1.62):
/////////////////////////////////////////////////////////////
#include <boost/variant.hpp>
template<class Node>
struct node1_type;
struct var_type;
using var_base = boost::variant<int,
boost::recursive_wrapper<node1_type<var_type>>
>;
template<class Node>
struct node1_type
{
Node child;
};
struct var_type : var_base
{
using var_base::var_base;
};
int main()
{
var_type v1 = 1;
}
///////////////////////////////////////////////////////////////////
It crashes GCC:
http://melpon.org/wandbox/permlink/A6BuYqqrG4COcfFl
and produces compilation error with any released version of Clang:
http://melpon.org/wandbox/permlink/1JQ7OVLV3crERRJX
(Although it does compile with Clang-4 trunk).
I'd appreciate if Variant maintainers could take a look at it.
Thanks.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk