<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/107148>107148</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Weird bug with `-std=c2x`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
vmurali
</td>
</tr>
</table>
<pre>
```
$ clang --version
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
$ cat hello.i
void say_hello()
{
xoo::bar();
}
$ clang -c -std=c2x -x cpp-output hello.i
hello.i:3:6: error: expected ';' after expression
xoo::bar();
^
;
hello.i:3:3: error: use of undeclared identifier 'xoo'
xoo::bar();
^
^C ##### <----------------- HANGS WITH -std=c2x
$ clang -c -x cpp-output hello.i
hello.i:3:7: error: expected expression
xoo::bar();
^
1 error generated. ##### <------------ DOES NOT HANG without -std=c2x
$ cat hello.i
void __attribute__((cheri_compartment(("hello")))) say_hello()
{
foo::bar();
}
$ clang -c -std=c2x -x cpp-output hello.i
hello.i:3:3: error: use of undeclared identifier 'foo'; did you mean 'for'?
foo::bar();
^~~
for
hello.i:3:3: error: expected expression
2 errors generated. ##### <-------------------------------------- DOES NOT HANG with foo::bar !!!!
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8VU2P4ygQ_TX4gmzhwo6Tgw_pTntnLjOHiTR7iwhUElbEWIDT6cv89hW200nv9vTHZRBSQr2Cqvd4FsJ7vW8Ra1LekXKViD4crKtPx94Jo5OtVU81mbFpshVhSwIFlUa0e5qmJ3Re23YEll1ncIImgOZlxjJGCcyHeJqXjGU8W2QFgcW4bS3cHgPhSyrccVakIh6TKuEedQs8m2VT3fXBoVD0aBWamN1Zr88j9LX1QRiDaqVdhAg0sRktRdC29QSav6VVmImuI9Dc2zZgG2J4hSc0tkNHoFlba-RB6Gv-CneiNyE7y3DBCDS9j9lbPbG-EUUEekBjbKbpGD1ZragXT5shTGD-TJpUd-MfSs_WEr4kfLkVbkrhd5es1f-KjMpLmvqgCF9JONP0TGXXpbYPXf_cwrjlsuBLTvhyFsVB5-ygEp47lAEVJVDFklBRsQvoIuDQXy_2zR5pHKR8uF1dsJfV-YvqvUdqd7RvFUojHCqqFbZB7zS62FEsCdWHGniuTsqHe0qA305K-H3630G_LL_99YP-_Lr-ciPk77X-qMDV6wJ_TtBnOvl4FN1ji04EVBl9jx1dfX_4Qb99Xw8M6aMOB9uHtzi-btrNRoTg9LYPuNkMDc7lAZ3eSHvshAtHbMMYJgCTuyGyuMz3bL_7c67_nO92o-_4HVVa0Sfb0yOKdkTcgDSXS3yDw2DKX7-ume79zn5rFxhz_K0RPuLyV8crDnlBhBLIr3O8gcsDkKiaqwVfiATrvIKSL4q8gORQQ8FzmVdyLmcChJQLJaqScVAcyrIs54mugUHBFowDYwsGWVXMRFEtmCjLQgFHUjA8Cm0yY07HzLp9or3vsc5ZlRfzxIgtGj-8UgAtPtIBjZ4rV4mr46Z02-89KZjRPvjrMUEHg_VP1E7Rbb8fCZMZu_kkZizpnakPIXQ-6gANgWavw6HfZtIeCTTxtOkn7Zz9B2Ug0Aw9xNdiavJUw78BAAD__76sEyE">