<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/152460>152460</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Unreachable executed when using `opencl_local` attribute in SYCL
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:frontend,
crash-on-valid,
SYCL
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
Maetveis
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Maetveis
</td>
</tr>
</table>
<pre>
The following code, when compiled with `clang -fsycl test.cpp`
```cpp
int [[clang::opencl_generic]] *a;
```
makes clang crash with the message:
> Invalid address space
> UNREACHABLE executed at /root/llvm-project/llvm/tools/clang/lib/Sema/SemaType.cpp:6577!
[See it on Compiler Explorer](https://godbolt.org/z/q3no3voz6)
Clang should not crash, it should either accept or reject the input with a proper message.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxckk-PozgQxT9NcSklMiaG5MCBpIN2pd49bHcf9jQyphI849iMbdJ_Pv3IkEyPWkIgynK9eq9-MgR9tkQ1iD1w_o-keCUdgHMQD5mc4uB8fa9mnevf6-eB8OSMca_anlG5noAf8HUgi8pdRm2ox1cdB4SSKSPtGVen8K4MRgpxrcYRSgasSe_5SRXWaBsxzSD28x0oGigaN5JV5tuZLHmtQDyAeEDgjYRi_2cLYM1F_qCAi57yMgzLDHEgvFAI8kypJWugOOLf9iqN7lH2vacQMIxS0e3s5d__js3hr2b_eER6IzVF6lFGBN565yLw1pjrZTV6953U_Rd4G50zAXi7TM9bozvg7RNd5O3z_D7S7L5oSlFVwPOkyBoQ-yci1BGdxcMSoMfj22icJ5888-0Q4xjS_LwF3p5d3zkT184noQ_g7c_CuuLqPkrgu6XrYQ4iDG4yPVoXl0zSonS8l0nHgTxKpWiM6Dx6Sp7mzLQdp7hEKHH0biR_z3Gd9XXR74qdzKjOK7ERotyKMhtqKTrGVSdzQadKbMuqYJSzXNKp44p3KtM1Z1ywLavYVmzycr3ZMZlzUVZ9J3ai4rBhdJHarFOqyWCmQ5iozgXflCwzsiMTbqzeOTl5ZyPZPjHLD-kgWV05u5q3_Lv89P_h8ca1r-cldtM5wIYZHWL4VIw6GqpfrCepBtkZ-uRghnwKiXso2Y1O45Q0UDKUMXrdTTGlh0ktm7ypv-xOx2Hq1spdPtH5AtTsOKF0M32t-a8AAAD__3mqKm8">