diff options
author | Andres Noetzli <andres.noetzli@gmail.com> | 2021-05-21 09:05:45 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-21 16:05:45 +0000 |
commit | bb39d534c89dc2569aa048bb053196bfa5bbb3a1 (patch) | |
tree | be677fe7153c13cb36fac6d376ba24a78eeda763 /src/theory/arith | |
parent | 23b990946473910eb8c781d555a4600efeb05b4b (diff) |
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.
Diffstat (limited to 'src/theory/arith')
-rw-r--r-- | src/theory/arith/arith_utilities.h | 2 | ||||
-rw-r--r-- | src/theory/arith/bound_inference.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/theory/arith/arith_utilities.h b/src/theory/arith/arith_utilities.h index 6617fccb0..b842ae58e 100644 --- a/src/theory/arith/arith_utilities.h +++ b/src/theory/arith/arith_utilities.h @@ -231,7 +231,7 @@ inline Node getIdentity(Kind k){ case kind::MULT: case kind::NONLINEAR_MULT: return mkRationalNode(1); - default: Unreachable(); return {}; // silence warning + default: Unreachable(); return Node::null(); // silence warning } } diff --git a/src/theory/arith/bound_inference.cpp b/src/theory/arith/bound_inference.cpp index 3b40f925e..5824d8239 100644 --- a/src/theory/arith/bound_inference.cpp +++ b/src/theory/arith/bound_inference.cpp @@ -43,7 +43,7 @@ Bounds BoundInference::get(const Node& lhs) const auto it = d_bounds.find(lhs); if (it == d_bounds.end()) { - return Bounds{}; + return Bounds(); } return it->second; } |