<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Clang does not find begin/end of std::array wrapped in range view"
   href="https://bugs.llvm.org/show_bug.cgi?id=45841">45841</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang does not find begin/end of std::array wrapped in range view
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++2a
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>rhalbersma@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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 (<a href="https://godbolt.org/z/UA7W_E">https://godbolt.org/z/UA7W_E</a>)
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> &]</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>