<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/97217>97217</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
parser error on clang 18.1.8
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
memory-thrasher
</td>
</tr>
</table>
<pre>
I compiled clang from the latest tag because I didn't want to do an OS upgrade just to upgrade clang following this:
https://llvm.org/docs/GettingStarted.html#getting-the-source-code-and-building-llvm
except I used single branch mode to fetch the most recent release commit rather than master:
`git clone https://github.com/llvm/llvm-project.git --single-branch -b 'release/18.x' --depth 1`
`cmake -S llvm -B build -G 'Unix Makefiles' -DLLVM_ENABLE_PROJECTS='clang;clang-tools-extra;lldb;lld' -DCMAKE_BUILD_TYPE=Release`
I used make to install it to the default `/usr/local` prefix, leaving the ubuntu repo clang in `/usr`. The resulting binaries are no longer able to compile my project. My project is accessible here:
https://github.com/memory-thrasher/WITE
but I'm attaching the single header file that is causing the crash with a minimal `main.cpp` that includes it. I'm also attaching the console output as a txt file because I personally don't like scrolling past a wall of logs when looking at someone else's issue. Github wouldn't let me upload without appending .txt to each name.
[stderr.txt](https://github.com/user-attachments/files/16045088/stderr.txt)
[build.sh.txt](https://github.com/user-attachments/files/16045092/build.sh.txt)
[callback.hpp.txt](https://github.com/user-attachments/files/16045093/callback.hpp.txt)
[main.cpp.txt](https://github.com/user-attachments/files/16045094/main.cpp.txt)
[main-6089cf.cpp.txt](https://github.com/user-attachments/files/16045095/main-6089cf.cpp.txt)
[main-6089cf.sh.txt](https://github.com/user-attachments/files/16045096/main-6089cf.sh.txt)
I created /usr/local/bin/clang++-18 as a symlink to ./clang to make clear here the version difference. The bug also occurs with clang invoked as clang++
## Broken clang:
```
clang++-18 --std=c++20 -fPIC -g -Werror -Wall main.cpp -c -o main.o
$ clang++-18 --version
clang version 18.1.8 (https://github.com/llvm/llvm-project.git 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
```
## Working clang:
```
clang++-16 --std=c++20 -fPIC -g -Werror -Wall main.cpp -c -o main.o
$ clang++-16 --version
Ubuntu clang version 16.0.0-++20221021052626+7dd2f4bc009d-1~exp1~20221021172738.418
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
```
## Question
Is 18.1.8 meant to be stable or have I downloaded a beta by mistake? This seems like a beta kind of problem. If so, what is the latest stable? latest 17.x?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0V1Fv4zYS_jXMy4CCRNmS_eCHeB0vfLd73etmb3FPAUWOJNYUKZBU7Lz0tx8oyanjdosekAJBZMrD-YbzzXwcc-9VYxA3ZLkly90dH0Jr3abDzroXGlrHfYvurrLyZXMAYbteaZQgNDcN1M52EFoEzQP6AIE3UKHgg0c4gFTSEFYGOHETIFiQFriBn77C0DeOS4RfBj9-cVnPXq3W9qRMA6FVnuT3JN2R9L4NoR9XbE_YXuvnLrGuIWwvrfCE7T9iCMo0XwN3AWXShk4TljfTWxpapN4OTiAVViLlRtJqUFrGL6OzCQTPAvsABxg8SvDKNBqhctyIFjorMUZbYxDteOzO-gAOBZr40Mg9xhR1KoDjoUUHoeUGOu4DuteDkCJtVAChrUF4e6pGhXaoEmG7-Yjzg_bO_oIiJHEjpVNcdI6LVkBYOeMTts9WyZmwEiiV2IcWMlKkM_IFX3T8iEC_QnQOdAtjKoB-jJ6-GXWGz_yItdLoR0-7T5_-8_np4V_3208PT19-_ukfDx8ev5J8R1g5ckby7fikwVrtKZ6D4yTfai2r6TF5-fD5_p8PT9tvh0-7p8f_fnkg-e7nOeybEMf_MwtjrMGCMj5wrUGNNRPzL7Hmgw4Qd7P94F1MlxVckyKF3mGtzoR9AI38eSonhKEaTBjAYW_nclPman-RJvDYIjj0g46FA5Uy3Cn0wB2CsaCtad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