<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/69801>69801</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang crash trying to use c++20 modules
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
rnikander
</td>
</tr>
</table>
<pre>
I just built clang from source (Oct 20, 2023) and tried a small program with a module, and I get this crash. There's a problem in the code (missing `std::` in front of `vector`), but of course it would be better to report whatever the problem is, instead of crashing.
File `buildsys.ccm`:
```c++
module;
#include <iostream>
export module buildsys;
```
File `main.cc`:
```c++
#include <vector>
import buildsys;
vector<int> nums;
```
This is my build script.
File `build.sh`:
```sh
CXX=/Users/rob/Dev/llvm-project/build_phase1/bin/clang++
MACOS_SDK=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk
CMD_START="$CXX -isysroot $MACOS_SDK -std=c++2b"
$CMD_START buildsys.ccm --precompile -fprebuilt-module-path=. -o buildsys.pcm
MF1="-fmodule-file=buildsys=buildsys.pcm"
$CMD_START -c main.cc $MF1 -o main.o
```
I'm running on a Intel MacBook Pro with macOS 14.0.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEVN1u2zgTfRr6ZiCBomQ7vtBFYlVAUAQpvuQDfBdQ1Nhiwx-BpJL12y9IybW77W4BwrCGc2YODw-Hey9PBrEm6weyblZ8CoN1tTPynZse3aqz_bl-hO-TD9BNUgUQipsTHJ3V4O3kBAJhd88iAKOE7YFRVhK2A256CE5iDxy85krB6OzJcQ2fMgzAQdt-UhghMfURThggDNKDcNwPObwO6JCwrQceoZ1CDdJAGBCE7VNXLb2X5gRkQ33oSXkf14bGtKOzJoA9xr0PFME6sqGE7WK_bko7wk7OI8gAn3ZSPXQIHYaADoIFh6N1AT4HHvAjhga8svCxijQ-IO9TpchYml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