<html>
    <head>
      <base href="http://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 crashes with arrays of std::complex"
   href="http://bugs.llvm.org/show_bug.cgi?id=32822">32822</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang crashes with arrays of std::complex
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>4.0
          </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>release blocker
          </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>powerchord@web.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=18370" name="attach_18370" title="Error message with Visual Studio 2017">attachment 18370</a> <a href="attachment.cgi?id=18370&action=edit" title="Error message with Visual Studio 2017">[details]</a></span>
Error message with Visual Studio 2017

#include <complex>

// clang crashes here with any array size > 1
std::complex<double> v[2];

// I suppose the reason is a constexpr constructor with the parameter type
being const &. Please see the following explanation and the attachment

struct A
{
    constexpr A(const int & = 0) {}
};
struct B    // = A without &
{
    constexpr B(const int /*&*/ = 0) {}
};
struct C    // = A without constexpr
{
    /*constexpr*/ C(const int & = 0) {}
};

A a1[1];    // OK
A a2[2];    // clang crashes
B b[2];     // OK
C c[2];     // OK</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>