Skip to content

vendor: libc++ 19/20 ranges::contains over views::join of a 2-D array finds a missing value #218

Open

Description

@homer6

Vendor bug report draft (from #185). Not filed upstream: filing needs the owner's yes.

Bug: with libc++ 19 and 20, std::ranges::contains over views::join of a built-in 2-D array returns true for a value that isn't there. libc++ 21 is correct.

#include <algorithm>
#include <ranges>
int main() {
    constexpr int g[3][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
    return std::ranges::contains(g | std::views::join, 10);  // libc++ 19/20: 1, expected 0
}

Seen on: Ubuntu 24.04 Clang 19 and 20 with libc++, and Apple Clang 17 (libc++ 19-based), in run https://github.com/homer6/cpp-docs/actions/runs/41380889279 (found in #209, gated in #210).

In the suite: tests/language/statements/jump-statements_test.cpp, JumpStatements.GotoOutOfNestedLoops, skips on _LIBCPP_VERSION < 210000 naming the bug.

Before filing: search llvm/llvm-project for an existing report or the fixing commit (it's fixed in 21, so it may only need a link here, not a new report). Then confirm the reproducer on libc++ 20 outside the suite.

Activity

  1. self-assigned this
    on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions