Skip to content

Building Storm in DEBUG fails: SparseModelFromUmb.cpp #912

@plindnercs

Description

@plindnercs

When building the current main branch of Storm locally, I get the following error:

.../src/storm/storage/umb/import/SparseModelFromUmb.cpp: In function storm::models::sparse::StateLabeling storm::umb::detail::constructStateLabeling(const storm::umb::UmbModel&):
.../src/storm/storage/umb/import/SparseModelFromUmb.cpp:96:73: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
   96 |         for (auto const& [apName, apIndex] : umbModel.index.aps().value()) {
      |                                                                         ^

I am not sure if this is a global issue or due to my local environment, but replacing:

for (auto const& [apName, apIndex] : umbModel.index.aps().value()) {

with

auto apsOpt = umbModel.index.aps();
auto const& aps = apsOpt.value();
for (auto const& [apName, apIndex] : aps) {

and applying the same pattern for constructRewardModels solves the issue for me.

It would be nice if someone could double-check this behavior, thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions