<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 --- - Assertion failed: ((!Initializer || isa&lt;ImplicitValueInitExpr&gt;(Initializer) || isa&lt;CXXConstructExpr&gt;(Initializer)) &amp;&amp; &quot;Initializer expression that cannot have been implicitly created.&quot;), function BuildCXXNew" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D23932&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=4RLnrUOCr0cNVTLrqLyItecOTidjU393lcn1Wn6OM8s&s=bZg3MXRGNx3pZi1HrMDUstYmRThBOM5145w0y5rNXdA&e=">23932</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion failed: ((!Initializer || isa<ImplicitValueInitExpr>(Initializer) || isa<CXXConstructExpr>(Initializer)) && "Initializer expression that cannot have been implicitly created."), function BuildCXXNew
          </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>Frontend
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>compnerd@compnerd.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Reduced test case:

// %clang_cc1 -emit-obj -fobjc-arc -Os -x objective-c++ %s
// REQUIRES: asserts

template <typename T> const id *f() { return new id; }
auto i = f<int>();

// template <typename T> const id *f() { new id[32]; return nullptr; }


With ARC, id needs to be value initialized.  The TreeTransform over the
template specialization will transform the ImplicitValueInitExpr into a
ParenListExpr, which breaks the initialization type check in BuildCXXNew.

The commented out test case is relevant as the single id case can be handled by
adding parenthesis to avoid setup the DirectInitRange value, while the same
workaround cannot be applied to the second case.</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>