Support braced-init-lists with `mkNode()` (#6580)
authorAndres Noetzli <andres.noetzli@gmail.com>
Fri, 21 May 2021 16:05:45 +0000 (09:05 -0700)
committerGitHub <noreply@github.com>
Fri, 21 May 2021 16:05:45 +0000 (16:05 +0000)
commitbb39d534c89dc2569aa048bb053196bfa5bbb3a1
treebe677fe7153c13cb36fac6d376ba24a78eeda763
parent23b990946473910eb8c781d555a4600efeb05b4b
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<TNode>`
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.
15 files changed:
src/expr/node.h
src/expr/node_manager.cpp
src/expr/node_manager.h
src/theory/arith/arith_utilities.h
src/theory/arith/bound_inference.cpp
src/theory/fp/theory_fp_rewriter.cpp
src/theory/strings/kinds
src/theory/strings/regexp_solver.cpp
src/theory/strings/sequences_rewriter.cpp
src/theory/strings/theory_strings_preprocess.cpp
test/unit/node/node_black.cpp
test/unit/node/node_manager_black.cpp
test/unit/theory/regexp_operation_black.cpp
test/unit/theory/sequences_rewriter_white.cpp
test/unit/util/boolean_simplification_black.cpp