3
以下代码crashes GCC并且无法使用Clang进行编译。它出什么问题了?继承boost :: variant和templatized AST
#include <boost/variant.hpp>
#include <array>
#include <iostream>
template<class Node>
struct wrapper1;
template<class Node>
struct wrapper2;
struct ast_node;
using ast_node_base = boost::variant<boost::recursive_wrapper<wrapper1<ast_node>>, boost::recursive_wrapper<wrapper2<ast_node>>>;
struct ast_node : ast_node_base
{
using ast_node_base::ast_node_base;
};
template<class Node>
struct wrapper1
{
std::array<Node, 1> children;
};
template<class Node>
struct wrapper2
{
std::array<Node, 2> children;
};
int main()
{
ast_node node;
std::cout << "done\n";
}
铛++ [喜欢它](http://coliru.stacked-crooked.com/a/26ff6c04b3597b01)太 – sehe