<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/120857>120857</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Clang] parser error
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
TrofiMichael
</td>
</tr>
</table>
<pre>
I'm trying to compile the following code:
```
class BigInteger {
friend bool operator==(const BigInteger&, const BigInteger&);
friend class Rational;
};
bool operator==(const BigInteger&, const BigInteger&) = default;
int main() {}
```
With clang++ -std=c++20
The compiler gives a parser error.
The next three files contain a compilation log, a cpp file and a sh file.
- [compilation_log.txt](https://github.com/user-attachments/files/18219989/compilation_log.txt)
- [clang_issue_cpp.txt](https://github.com/user-attachments/files/18220002/clang_issue_cpp.txt)
- [clang_issue_sh.txt](https://github.com/user-attachments/files/18220004/clang_issue_sh.txt)
All the following versions of clang fail to compile this:
- clang 20.0.0git
- x86-64 clang from 19.1.0 to 15.0.0
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyslEFvqzgQxz-NuYyCzAABDhxIo0g97GVVaY-VMQN4ZTCynbz22z8ZaF9TRe9UyVJie-b_G88wI5xTw0xUs_zE8nMkrn40tn6xplf_KDkK0lFruvea8eaZYTGBt-9qHsAbkGZalCbwI0FvtDa_woU0HbG0YbxhR74v3kgtnIOTGp5nTwNZYMWJ8Qagt4rmDlpjNJiFrPDGsvQcFpbSzM5_8WJ4ZPgED48rlt4pbsR_hVdmFnq7ZMV5_8ObHyACS8_QUS-u2n_qqtnDJNTMsFxNilOg3mfjP-XHEOA8MDwxPMHB-Y6lZ7ltkW9SLyN9JNnCoG7kQMAirCMLZK2xMexWM7158KMlgl5pciFgL9QMYhdY0wDaDOE1AuSyrIYg5g4EuHHdxRs2iB6A5acvrq_aDLF_8ywPWRq9X1woMl4YXgblx2sbSzMxvFwd2YPwXshxotk7hpc1IoaXpMSkqsqK4eWRMlaf3JCZV-XclV7lsvwAFznnGLgPlB9z3fhD2OwbdhdeqYw3jdbfGuhG1ikzOzD99o1AL5S-bzjlthY77BbIYx7zQfn17K08Ho7Zh7M1EyRVnMQ8aCR5sNzYUVenXZVWIqI6KdKsTIqqzKOxxqSVBeZZl-dYyKot2_x4LLryKFMs0zSNVI0cswQxwSRPeR5nadeRpKTt866kjrOM0ySUjrW-TbGxQ7S-vk6Ql3kRadGSduvQQdwbAcP8sXVwOLTXwbGMa-W8-yPhldfrpHpaPfLzXTNEV6vrv5QqyOw_h8Wa_0l6hpc1rLVcW2S3Gn8HAAD__-jcmQY">