Skip to content

Clang-Tidy 19 incorrectly replaces std::expected with std::unexpected #140439

Open
@magnesj

Description

@magnesj

The following line in ResInsight is incorrectly updated by clang-tidy-19

std::expected<caf::PdmObjectHandle, QString> result = method->execute();
is changed to
std::unexpected<caf::PdmObjectHandle, QString> result = method->execute();

Using auto result = method->execute(); works correct without any issues.

https://github.com/OPM/ResInsight/blob/7899736f0501f742e45e6dd6022e75136251a6bd/GrpcInterface/RiaGrpcPdmObjectService.cpp#L556

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang-tidyincompleteIssue not complete (e.g. missing a reproducer, build arguments, etc.)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions