<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 - regression Clang >= 11 rejects consteval subscript operator use"
   href="https://bugs.llvm.org/show_bug.cgi?id=50779">50779</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>regression Clang >= 11 rejects consteval subscript operator use
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>11.0
          </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>wjwray@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>This is a regression between versions 10.0.1 and 11.0.0
<a href="https://godbolt.org/z/dcnbbcKqs">https://godbolt.org/z/dcnbbcKqs</a>

    struct test
    {
        consteval int operator[](int i) const { return {}; }
    };

    constexpr test a{};

    constexpr int s = a.operator[](1); // accept direct call
    constexpr int t = a[1];            // REJECT 

  error: cannot take address of consteval function 'operator[]'  
  outside of an immediate invocation:
    constexpr int t = a[1];
                       ^

Works on GCC >=10.2 but ICE'd 10.1 (which introduced consteval)
 internal compiler error: in extract_call_expr, at cp/call.c:6614
   13 | constexpr int t = a[1];
      |                      ^

Works on MSVC >= v19.28 (which introduced consteval)</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>