summaryrefslogtreecommitdiff
path: root/src/api/cvc4cpp.h
diff options
context:
space:
mode:
authorAndres Noetzli <andres.noetzli@gmail.com>2018-11-05 09:01:03 -0800
committerAina Niemetz <aina.niemetz@gmail.com>2018-11-05 09:01:03 -0800
commit52ee910c128e6bbcf7299a0660511deacadb14f1 (patch)
tree89a05c005d82e660cdd626441740c719536ea9d6 /src/api/cvc4cpp.h
parent4d65e4b5efecc631bfda19900327cd5da2d740f7 (diff)
API: Fix assignment operators (#2680)
The assignment operators of `Term`, `OpTerm`, and `Sort` currently have an issue. The operators dereference their `shared_ptr` member and assign the corresponding member of the other object. This is problematic because if we have for example two `Term`s pointing to the same `Expr`, then the assignment changes both `Term`s even though we only assign to one, which is not what we want (see the unit test in this commit for a concrete example of the desired behavior). To fix the issue, the assignment operator should just copy the pointer of the other object. This happens to be the behavior of the default assignment operator, so this commit simply removes the overloaded assignment operators. Testing: I did `make check` with an ASAN build and no errors other than the one fixed in #2607 were reported.
Diffstat (limited to 'src/api/cvc4cpp.h')
-rw-r--r--src/api/cvc4cpp.h23
1 files changed, 0 insertions, 23 deletions
diff --git a/src/api/cvc4cpp.h b/src/api/cvc4cpp.h
index fc07a1cd7..aebeffb0d 100644
--- a/src/api/cvc4cpp.h
+++ b/src/api/cvc4cpp.h
@@ -197,13 +197,6 @@ class CVC4_PUBLIC Sort
~Sort();
/**
- * Assignment operator.
- * @param s the sort to assign to this sort
- * @return this sort after assignment
- */
- Sort& operator=(const Sort& s);
-
- /**
* Comparison for structural equality.
* @param s the sort to compare to
* @return true if the sorts are equal
@@ -554,14 +547,6 @@ class CVC4_PUBLIC Term
~Term();
/**
- * Assignment operator, makes a copy of the given term.
- * Both terms must belong to the same solver object.
- * @param t the term to assign
- * @return the reference to this term after assignment
- */
- Term& operator=(const Term& t);
-
- /**
* Syntactic equality operator.
* Return true if both terms are syntactically identical.
* Both terms must belong to the same solver object.
@@ -844,14 +829,6 @@ class CVC4_PUBLIC OpTerm
~OpTerm();
/**
- * Assignment operator, makes a copy of the given operator term.
- * Both terms must belong to the same solver object.
- * @param t the term to assign
- * @return the reference to this operator term after assignment
- */
- OpTerm& operator=(const OpTerm& t);
-
- /**
* Syntactic equality operator.
* Return true if both operator terms are syntactically identical.
* Both operator terms must belong to the same solver object.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback