<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 segfaults on brace-init of struct containing a struct with shared-ptr and a struct with implict ctor and C-Array"
   href="https://bugs.llvm.org/show_bug.cgi?id=36967">36967</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang segfaults on brace-init of struct containing a struct with shared-ptr and a struct with implict ctor and C-Array
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>6.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++
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>oss@florianjw.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The following code causes clang to crash on my system:


#include <memory>

struct a {
        std::shared_ptr<int> ptr;
};

struct b {
        b (int) {}
        int data[1];
};

struct c {
        a pk;
        b sk;
};

c fun(a x) { return {x, 0}; }

the stdlib I am using is libstdc++ 7.3.1 on arch-linux. I don't use any special
commandline-parameters, `clang++ -c main.cpp` is enough (maybe add `-std=c++11`
for `std::shared_ptr` though)

I skimmed over the open bugs with “segfault” in their description, but didn't
see anything that clearly makes this a duplicate.

I tried to remove the dependency to `std::shared_ptr` but at some point I lost
the nerve and decided getting rid of gmpxx was enough.</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>