Thanks to visit codestin.com
Credit goes to github.com

Skip to content

change of no-error path behavior leading to maybe-uninitialized warning #264

@slymz

Description

@slymz

Repro and detailed description here:

https://godbolt.org/z/YG6e8q3Y5

Excerpt:

using Result =
    outcome::result<std::tuple<int, std::string>, InHouseErrorz *, MyNVP>;

auto foo() {
    Result r{1, "a"};
    // r = nullptr; //< UNCOMMENT to eliminate warning
    r = {2, "b"};
    return r.assume_value();
}

Very likely that this is a GCC issue (in fact, can't be reproduced in trunk). Yet, it is a curious phenomenon and causing production hassle with our boost upgrade. I am wondering if this is an expected change with later Outcome versions, or worse and crucially if the usage in the reproduction code is somewhat making incorrect assumptions.

Or, if there is confirmation this is just a silly GCC bug, it'd be a good enough resolution.

thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions