diff --git a/spot/twacube/twacube.cc b/spot/twacube/twacube.cc index 1ec95aa14..11b822c07 100644 --- a/spot/twacube/twacube.cc +++ b/spot/twacube/twacube.cc @@ -81,10 +81,10 @@ namespace spot init_ = init; } - unsigned twacube::get_initial() + unsigned twacube::get_initial() const { if (theg_.num_states() == 0) - new_state(); + throw std::runtime_error("automaton has no state at all"); return init_; } diff --git a/spot/twacube/twacube.hh b/spot/twacube/twacube.hh index 5afccd881..b9732dbb6 100644 --- a/spot/twacube/twacube.hh +++ b/spot/twacube/twacube.hh @@ -148,7 +148,7 @@ namespace spot void set_initial(unsigned init); /// \brief Returns the id of the initial state in the automaton. - unsigned get_initial(); + unsigned get_initial() const; /// \brief Accessor for a state from its id. cstate* state_from_int(unsigned i);