ExprManagerScope ems(*d_em);
d_internal.reset();
d_constructors.clear();
- delete d_record;
}
Datatype::Datatype(ExprManager* em, std::string name, bool isCo)
for( unsigned i=0; i<(*this)[0].getNumArgs(); i++ ){
fields.push_back( std::pair<std::string, Type>( (*this)[0][i].getName(), (*this)[0][i].getRangeType() ) );
}
- d_record = new Record(fields);
+ d_record.reset(new Record(fields));
}
}
bool Datatype::isRecord() const { return d_isRecord; }
-Record* Datatype::getRecord() const { return d_record; }
+Record* Datatype::getRecord() const { return d_record.get(); }
bool Datatype::operator!=(const Datatype& other) const
{
return !(*this == other);
/** self type */
Type d_self;
/** the data of the record for this datatype (if applicable) */
- Record* d_record;
+ std::shared_ptr<Record> d_record;
/** whether the datatype is a record */
bool d_isRecord;
/** the constructors of this datatype */
std::vector<std::pair<std::string, Sort>> empty;
TS_ASSERT_THROWS_NOTHING(d_solver->mkRecordSort(fields));
TS_ASSERT_THROWS_NOTHING(d_solver->mkRecordSort(empty));
+ Sort recSort = d_solver->mkRecordSort(fields);
+ TS_ASSERT_THROWS_NOTHING(recSort.getDatatype());
}
void SolverBlack::testMkSetSort()