[llvm-bugs] [Bug 45841] New: Clang does not find begin/end of std::array wrapped in range view

via llvm-bugs llvm-bugs at lists.llvm.org
Fri May 8 05:01:40 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=45841

            Bug ID: 45841
           Summary: Clang does not find begin/end of std::array wrapped in
                    range view
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: rhalbersma at gmail.com
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

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

#include <array>
#include <iostream>
#include <ranges>

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
'<deduction guide for reverse_view>' [with _Range = std::array<int, 3> &]

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200508/83fb68be/attachment-0001.html>


More information about the llvm-bugs mailing list