Skip to content

Commit 911b14a

Browse files
author
Daniel Kroening
committed
remove mathematical_typet() constructor, which produces an incomplete object
1 parent 5d0d00a commit 911b14a

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/solvers/smt2/smt2_parser.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ typet smt2_parsert::function_signature_definition()
10281028
return sort();
10291029
}
10301030

1031-
mathematical_function_typet result;
1031+
mathematical_function_typet result({}, nil_typet());
10321032

10331033
while(peek()!=CLOSE)
10341034
{
@@ -1081,7 +1081,7 @@ typet smt2_parsert::function_signature_declaration()
10811081
return sort();
10821082
}
10831083

1084-
mathematical_function_typet result;
1084+
mathematical_function_typet result({}, nil_typet());
10851085

10861086
while(peek()!=CLOSE)
10871087
{

src/util/std_types.h

+8-5
Original file line numberDiff line numberDiff line change
@@ -1686,11 +1686,6 @@ inline complex_typet &to_complex_type(typet &type)
16861686
class mathematical_function_typet:public typet
16871687
{
16881688
public:
1689-
mathematical_function_typet():typet(ID_mathematical_function)
1690-
{
1691-
subtypes().resize(2);
1692-
}
1693-
16941689
// the domain of the function is composed of zero, one, or
16951690
// many variables
16961691
class variablet:public irept
@@ -1720,6 +1715,14 @@ class mathematical_function_typet:public typet
17201715

17211716
using domaint=std::vector<variablet>;
17221717

1718+
mathematical_function_typet(
1719+
const domaint &_domain, const typet &_codomain):typet(ID_mathematical_function)
1720+
{
1721+
subtypes().resize(2);
1722+
domain()=_domain;
1723+
codomain()=_codomain;
1724+
}
1725+
17231726
domaint &domain()
17241727
{
17251728
return (domaint &)subtypes()[0].subtypes();

0 commit comments

Comments
 (0)