From bb39d534c89dc2569aa048bb053196bfa5bbb3a1 Mon Sep 17 00:00:00 2001 From: Andres Noetzli Date: Fri, 21 May 2021 09:05:45 -0700 Subject: Support braced-init-lists with `mkNode()` (#6580) This commit adds support for braced-init-lists in calls to `mkNode()`, e.g., `mkNode(REGEXP_EMPTY, {})`. Previously, such a call would result in a node of kind `REGEXP_EMPTY` with a single null node as a child because the compiler chose the `mkNode(Kind kind, TNode child1)` variant and converted `{}` to a node using the default constructor. This commit adds an overload of `mkNode()` that takes an `initializer_list` to allow this use case. It also adds a `mkNode()` overload with zero children for convenience and removes the 4- and 5-children variants because they saw little use. Finally, it makes the default constructor of `NodeTemplate` explicit to avoid accidental conversions. --- test/unit/node/node_black.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/unit/node/node_black.cpp') diff --git a/test/unit/node/node_black.cpp b/test/unit/node/node_black.cpp index 2309c0ac7..852f06dbc 100644 --- a/test/unit/node/node_black.cpp +++ b/test/unit/node/node_black.cpp @@ -620,7 +620,7 @@ TEST_F(TestNodeBlackNode, dagifier) Node fgx_eq_gy = d_nodeManager->mkNode(EQUAL, fgx, gy); Node n = d_nodeManager->mkNode( - OR, fffx_eq_x, fffx_eq_y, fx_eq_gx, x_eq_y, fgx_eq_gy); + OR, {fffx_eq_x, fffx_eq_y, fx_eq_gx, x_eq_y, fgx_eq_gy}); std::stringstream sstr; sstr << Node::setdepth(-1) << Node::setlanguage(language::output::LANG_CVC); -- cgit v1.2.3