[variant] gcc crash

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[variant] gcc crash

Igor R.
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.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [variant] gcc crash

Antony Polukhin
2016-12-17 23:57 GMT+03:00 Igor R <[hidden email]>:
> Consider the following snippet (trying to compile with Boost 1.62):
<...>
> 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).

This touches a relatively new change in variant that SFINAEs
constructors. I'll investigate further soon.

Have you reported the issue at the GCC tracker?

--
Best regards,
Antony Polukhin

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [variant] gcc crash

Igor R.
> Have you reported the issue at the GCC tracker?

Done:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78852