Skip to content

Clang does not find begin/end of std::array wrapped in range view #45186

Closed as not planned
@llvmbot

Description

@llvmbot
Bugzilla Link 45841
Version trunk
OS Linux
Reporter LLVM Bugzilla Contributor
CC @zygoloid

Extended Description

The following code compiles on GCC-10 (which now implements the header) and produces 3,2,1 as output.

#include
#include
#include

int main()
{
auto arr = std::array{1, 2, 3};
for (auto elem: std::ranges::reverse_view(arr)) {
std::cout << elem << ",";
}
}

Compiling this with Clang-trunk on godbolt.org (https://godbolt.org/z/UA7W_E) gives an error that it cannot find begin/end of the std::array wrapped in the std::ranges::reverse_view adaptor, apparently because of misunderstood deduction guide:

while substituting deduced template arguments into function template '' [with _Range = std::array<int, 3> &]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++20clang:frontendLanguage frontend issues, e.g. anything involving "Sema"conceptsC++20 conceptsduplicateResolved as duplicate

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions