<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/123726>123726</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang 20: Sporadic crashes of clang-tidy check modernize-use-constraints
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang,
clang-tidy
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
pkl97
</td>
</tr>
</table>
<pre>
clang-tidy check modernize-use-constraints crashes sporadically (approximately in 5% of the runs) when given this program to analyze:
```c++
#include <boost/filesystem/path.hpp>
int main(int argc, char** argv)
{
return EXIT_FAILURE;
}
```
boost/filesystem/path.hpp was taken from the current version Boost 1.87.0.
Script to run clang-tidy in a loop:
```Shell
for i in {0001..1000}
do
echo "Iteration $i"
clang-tidy --extra-arg=-I/usr/local/clang20el9/include/c++/v1 --checks=-*,modernize-use-constraints --header-filter=^/home/user/devel/PROJECTS/.* -p /home/user/devel /home/user/devel/PROJECTS/FileWriter/UnityBuild.cpp
done
```
A dump of the crash:
[ClangTidyCrash.txt](https://github.com/user-attachments/files/18488796/ClangTidyCrash.txt)
The last commit included in my clang 20 build from branch master is 106c483a102e1328f11e2b1d9398f4ad2826b59f from 2025-01-19.
The crash does not occur in clang-tidy 19 with the same Boost header file.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMVN-PozYQ_muclxHIDCHAAw_5sUhbVWp1u6f2rTJmCO4aG9kmu7m_vjLJ9rbt3akSUsIwnvnm-z6P8F6dDVHDigMrThuxhNG6Zn7RdbnpbH9tpBbmnATVX0GOJF9gsj05o75QsnhKpDU-OKFM8CCd8CN58LN1oldSaH0FhpWYZ2ff1CQC6SsoAwXDAuwAYSRwi_EMa3gdycBZXchAGJWH2dmzExMEC8IIff1CLN8zvmc7fnskw0N8-J5hrozUS0_A8mNnrQ8M20Fp8lcfaGLYziKM6TjPLH-IB_hemQCTUIZhFf8Kd5YMjyBH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