<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 goes into infinite loop during template instantiation while processing co_await expression"
   href="https://bugs.llvm.org/show_bug.cgi?id=33414">33414</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang goes into infinite loop during template instantiation while processing co_await expression
          </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>Windows NT
          </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>Frontend
          </td>
        </tr>

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

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

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=18619" name="attach_18619" title="Preprocessed output of">attachment 18619</a> <a href="attachment.cgi?id=18619&action=edit" title="Preprocessed output of">[details]</a></span>
Preprocessed output of

Compile the attached preprocessor output with:
clang -x c++ -std=c++1z -fcoroutines-ts -fms-compatibility llvm_bug.ii

Seems to get stuck in an infinite loop inside
Sema::PerformPendingInstantiations().

It pulls a pending instantiation off the queue and calls
InstantiateFunctionDefinition().
However InstantiateFunctionDefinition() decides to defer instantiation (due to
late-parsed template?) and puts it back on the queue only to be picked up
immediately next time around the loop in PerformPendingInstantiations().

The particular template it is trying to instantiate is
coroutine_handle<task_promise>::promise() during compilation of a co_await
expression.

Built against code from github llvm-mirror:
llvm: 5db707b0ff5ce707a78082219658a999b6b6eaa3
clang: ff4214ddcfab9fd92c15cc01c9c2e17a8f6217ad</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>