<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 hangs in template instantiation after diagnosing C++11 narrowing in NTTP."
   href="https://llvm.org/bugs/show_bug.cgi?id=25857">25857</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang hangs in template instantiation after diagnosing C++11 narrowing in NTTP.
          </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>All
          </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++11
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>eric@efcs.ca
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=15474" name="attach_15474" title="reproducer.cpp">attachment 15474</a> <a href="attachment.cgi?id=15474&action=edit" title="reproducer.cpp">[details]</a></span>
reproducer.cpp

The attached reproducer causes clang to hang after in instantiates the `__make`
template with `-3`. Clang will emit a C++11 narrowing error before silently
hanging. My guess is that clang trys to instantiate the base class of
`__parity` with the converted value 4294967293.

metaprogramming often uses an integer NTTP to control the number of
instantiations. If clang instantiates a template with a narrowed NTTP it could
be in for a long ride.

I would be willing to work on a fix if somebody could offer direction on the
solution.</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>