<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 - Assertion "faked up lambda definition?" failed."
   href="https://bugs.llvm.org/show_bug.cgi?id=32556">32556</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion "faked up lambda definition?" failed.
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Modules
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>panin@fb.com
          </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=18240" name="attach_18240" title="Archive with files involved">attachment 18240</a> <a href="attachment.cgi?id=18240&action=edit" title="Archive with files involved">[details]</a></span>
Archive with files involved

Clang crashes in assertion when trying to build with -fmodules enabled:
void clang::ASTDeclReader::MergeDefinitionData(clang::CXXRecordDecl*,
clang::CXXRecordDecl::DefinitionData&&): Assertion `!DD.IsLambda &&
!MergeDD.IsLambda && "faked up lambda definition?"' failed.

Repro:
clang++ --std=c++14 -I . -Rmodule-build -fmodules -fcxx-modules
-fmodules-cache-path=./modules_out/_module_cache -c main.cpp -o main.o

Stack trace: see stack.txt in archive.

If I build without modules then it works fine:
clang++ --std=c++14 -I . -c main.cpp -o main.o

Tested this using latest clang:
$ clang++ --version
clang version 5.0.0 (<a href="http://llvm.org/git/clang.git">http://llvm.org/git/clang.git</a>
6abfe5cfd2160d5c1c8594673ae995151afad6f5) (<a href="http://llvm.org/git/llvm.git">http://llvm.org/git/llvm.git</a>
54eda943893db59f794921a0affaa862b0ae0452)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /data/users/panin/llvm-hacking/build/bin</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>