<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 - ICE with C++ module when exporting forward declarations"
   href="https://bugs.llvm.org/show_bug.cgi?id=40572">40572</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ICE with C++ module when exporting forward declarations
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

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

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

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>mjklaim@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=21419" name="attach_21419" title="Complete log of build2 verbose build with all commands used.">attachment 21419</a> <a href="attachment.cgi?id=21419&action=edit" title="Complete log of build2 verbose build with all commands used.">[details]</a></span>
Complete log of build2 verbose build with all commands used.

Repro case (using build2): <a href="https://github.com/Klaim/clang_modules_ts_ice/">https://github.com/Klaim/clang_modules_ts_ice/</a>

I get an ICE when attempting to compile a C++ module (`clang++ -std=c++2a
-D__cpp_modules=201704 -fmodules-ts`, generated using Build2) which content is:

    export module mystd;

    #include <typeinfo>
    #include <vector>
    #include <string>
    #include <variant>
    #include <iostream>

    export std::vector;
    export std::string;
    export std::variant;
    export std::type_info;
    export std::cout;

See:
<a href="https://github.com/Klaim/clang_modules_ts_ice/blob/master/test_clang_ice_module/mystd.mxx">https://github.com/Klaim/clang_modules_ts_ice/blob/master/test_clang_ice_module/mystd.mxx</a>

Which I believe is incorrect anyway, I get error reports when I remove some of
the export lines.

Here is the error report:

====

Wrote crash dump file
"C:\Users\klaim\AppData\Local\Temp\clang++.exe-85d2ea.dmp"
0x00007FF75658E105 (0x0000008FB258B630 0x00007FF75538BF45 0x0000023E5A5C75A0
0x0000023E5A5C7568)
0x00007FF75555C1C2 (0x0000023E57BA5640 0x0000000000000000 0x0000023E5A4CC550
0x0000000000000016)
0x00007FF753DDA5FF (0x0000023E57B95370 0x0000023E57BC5F00 0x0000023E57BC5EF0
0x00007FF753DDA161)
0x00007FF753DDA213 (0x0000000000000400 0x00007FF75576A5C3 0x0000008F00000000
0x00007FF700000001)
0x00007FF754217B28 (0x0000001100000010 0x0000001300000012 0x0000001500000014
0x00007FF700000016)
0x00007FF753DD5EB0 (0x0000000000000000 0x0000000000000000 0x0000DB1CA2510547
0x0000023E57BBDAC0)
0x00007FF753DDA126 (0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000000000)
0x00007FF754D01D1A (0x0000023E5A16CEC0 0x0000000000000000 0x0000000000000000
0x00007FF754DE1E7C)
0x00007FF754D9786C (0x0000008FB258D730 0x0000000000000000 0x0000023E57C60080
0x00007FF754BAB751)
0x00007FF754D96CC5 (0xFFFFFFFFFFFFFFF8 0x0000023E57BD6910 0xFFFFFFFFFFFFFFF8
0x000000000000000F)
0x00007FF754D95FC2 (0x0000000000000003 0x0000023E57C60080 0x0000008FB258CD68
0x0000008FB258DB10)
0x00007FF754B5E92C (0x0000000000000001 0x0000023E5A5C6BA8 0x0000000000000000
0x000000000026D7E9)
0x00007FF754B5CDB1 (0x0000008FB258D740 0x00007FF75658C8F0 0x0000023E59AED788
0x0000008FB258D720)
0x00007FF754B1AF2F (0x0000DB1CA25117E7 0x0000023E5A2748E8 0x0000023E59AED788
0x0000000000000003)
0x00007FF754B1A900 (0x000000000026D7E2 0x0000000000000000 0x0000000000000000
0x00007FF754DD367A)
0x00007FF754B19483 (0x0000000000000000 0x0000023E57C60090 0x0000008FB258DD30
0x00007FF7555D3744)
0x00007FF754B3B55A (0x0000DB1CA2511B47 0x00007FF7555D37EC 0x0000008FB258DDD0
0x0000023E59C6D4B0)
0x00007FF754B18E1E (0x0000008FB258DDD0 0x0000023E57C60080 0x0000000000000000
0x0000000000000000)
0x00007FF754B18299 (0x0000000000000002 0x0000008F00000000 0x0000000057AC1401
0x0000023E57B7D640)
0x00007FF754B14BE6 (0x0000000000000000 0x0000000000000000 0x0000023E57B9AAF0
0x0000023E57B846D0)
0x00007FF75426431D (0x0000008FB258DEC8 0x00007FF756760B08 0x0000000000000000
0x00007FF7542BC719)
0x00007FF754228CC7 (0x0000008FB258E101 0x0000000000000000 0x0000000000000000
0x0000023E57B95F20)
0x00007FF7542BD37C (0x0000023E57BA22D0 0x0000023E57B40000 0x0000000000000101
0x00007FFB472A0000)
0x00007FF7528C6E28 (0x0000008FB258F801 0x0000000000000000 0x0000008FB2580000
0x00007FFB440DF101)
0x00007FF7528C4317 (0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000000000)
0x00007FF75576A7E8 (0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000000000)
0x00007FFB46B97E94 (0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000000000), BaseThreadInitThunk() + 0x14 bytes(s)
0x00007FFB4730A251 (0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000000000), RtlUserThreadStart() + 0x21 bytes(s)
clang++.exe: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 7.0.1 (tags/RELEASE_701/final)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
clang++.exe: note: diagnostic msg: PLEASE submit a bug report to
<a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash backtrace, preprocessed source,
and associated run script.
clang++.exe: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++.exe: note: diagnostic msg:
C:\Users\klaim\AppData\Local\Temp\mystd-2c3bd9.cppm
clang++.exe: note: diagnostic msg:
C:\Users\klaim\AppData\Local\Temp\mystd-2c3bd9.sh
clang++.exe: note: diagnostic msg:

====

See attached the complete output provided by `b --verbose 4`.</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>