<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63092>63092</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Clang] Crash when LogicalErrorHandler::hasActiveDiagnostics is true
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
hazohelet
</td>
</tr>
</table>
<pre>
Reproducer:
```c++
struct Y {
~Y();
};
void test() {
goto end;
Y y;
end:;
}
```
Live demo: https://godbolt.org/z/jv871z7jM
Another, which causes assertion failure elsewhere
```c++
void test() {
for (;; ({ continue; })) {}
}
```
Live demo: https://godbolt.org/z/rdMozhhMe
This crash seems to happen when `LogicalErrorHandler::hasActiveDiagnostics` evaluates true, which means that `-Wtautological-overlap-compare` or `-Wtautological-bitwise-compare` is enabled.
Both reproducers are reduced from clang test codes.
Note:
On the second code, GCC emits an error, while Clang does not.
GCC output:
```
<source>:2:16: error: continue statement not within a loop
2 | for (;; ({ continue; })) {
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVEGL6zYQ_jXKZdjgSInjPfjgJC_t4W0LpVD2qEiTSIusMdI44e2hv73ICdlsHzxoeSBszWjm03yjT9I5-1NEbMVqI1a7mR7ZUWqdfieHAXl2IPut_QOHRHY0mITqRLUTVSfq6jqMkJsyJm_mNBqGVxDrmwf-fhWyEfJZqJtHrHcf8-l7Jm-BMfM18iEZAE7EBBjtPac4X-Hb3Z7Wuk_wnyu8ml_9GcFiT0J14JiHXLLkXsj9ieyBAs8pnYTcvwu5fzs368X7-u3lscwuEjtMQm7h4rxxYPSYMYPOGRN7inDUPowJAUPGi8OEP-rVD1kfKUHxq41Qm2m23oChyD6OOLnWu9LUW96d888gn-wLvTv3go_k_3Q-g0k6O8iIfQYmcHoYMMLFYQRRV1_p5I0OX1Ki9KuONlzlojqnc2fYn3Hn9SlSZm-yqCvAsw6jZszAacSPvvaoYwZ2mgvs01-sR6ZwRX-iM6aghydD_aATFpzSq-_iDp4vPuNjnM-AUR8C2vkjtQ2xg3SXeAadEBIWw8IxUQ8m6HiazgoMWcyf0n8jxvu1-D0CO4SMhqKdggutX7ZbwN5zBh0BS39uZAPCdsK2hBki8Q25JNDIw8jfX7ibqbaZxmRQqC9CdVKoblGX073Cq-6uFsisGXuMXDaAi2fnI2gIRMOH4CSI9Rb-h_Q-FzezrbLP6lnPsF3UzapZqFXVzFxrDpVe1ivZqKZRanmsm0V1lGqxWittjkc7862spKrqSi3WarFs5tjUq1Vlm-VhsWyW0oplhb32YR7CuS9ynfmcR2xrVT3LWdAHDHl6xqSMeIFpUUhZXrXUlpynw3jKYlkFnzl_oLDnML1_00mI1Q62k8wnWf8nTReBFSXPxhTaf90yz248zA31Qu7L1rff05DoDQ0LuZ8KzkLuJ0L_BAAA__-9hKsU">