Skip to content

[libc++] Incorrect behavior of ranges::find with join_view #158279

@lbonn

Description

@lbonn
#include <iostream>
#include <ranges>
#include <vector>

int main() {
    std::vector<std::vector<int>> vec{{1}, {2}};
    auto joined = vec | std::views::join;
    if (std::ranges::find(joined, 3) != std::ranges::end(joined)) {
        std::cout << "not ok\n";
    }
    return 0;
}

Reproduced with LLVM 21 locally and 18 to trunk with godbolt).
The example is working with clang+libstdc++ and gcc+libstdc++.

Maybe related to #93180?

Metadata

Metadata

Assignees

No one assigned

    Labels

    libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.rangesIssues related to `<ranges>`

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions