<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60521>60521</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Clang] Issue with additional default arguments in function redeclaration
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
elizabethandrews
</td>
</tr>
</table>
<pre>
Clang ignores function redeclaration which provides additional default arguments and throws diagnostic "error: no matching function for call" - https://godbolt.org/z/bnha5jEGG
The test passes if namespace M is defined after the function redeclaration - https://godbolt.org/z/c1qhWf7MP
Both cases should work.
Relevant C++ standard -
“When a declaration of a function is introduced by way of a using-declaration (7.3.3), any default argument information associated with the declaration is made known as well. If the function is redeclared thereafter in the namespace with additional default arguments, the additional arguments are also known at any point following the redeclaration where the using-declaration is in scope.”
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEVMGu2zYQ_BrqsrAgUZZtHXR4tuMghwBFUSDnFbkSmVCky6We4Hx9Ibmp_RKk70LD1Cx3ODNLZLaDJ2pFfRT1OcMpmRBbcvY7dpQMeh1p5qwL-taeHPoB7OBDJIZ-8irZ4CGSJuUw4vpvNlYZuMbwajUxoNZ22UcHmnqcXAKMwzSSTwzoNSQTw8ygLQ4-cLIKhJQUY4iiegEfYMSkjPXDo2EfIih0TkgJGwAwKV1ZVC9CXoS8DEF3waU8xEHIy3chL503WH_98PGjKM6ieLmvfxmCRJzgiszEYHvwOBJfURF8BssLX-tJA_aJIiRDv7vy5l0GqvzbfOn3n_94ZnAMyYDCpTmbMDkNc4jfcnjG_EmOXtEnOAl5FPIInNBrjBo2b3DigxSHQjSnL4Y8IDzTCz3gg7plsD7FoCdFGrobzHi7Qya2ftg8Vwp52OdVXgnZCHkC9LdfTATr-xDHOx6Zg7KYSMNsk1k1ez7PMoyoCb75MC9omMm5HD71b9W1_J_AtASEIt09sH4FPnxau_xfxBbaS8kT5il-kQAdhx980nrDa7A-QR-cC_MSu6X854hTpHX_V8lWeYFVuFL-w5TzG6fWNdNtpZuqwYzacrevt7XcH-rMtHpXH7YN7tS-6Ypu1xGVNTaKDp1s1E4eMtvKQlaFLKqyqaqiznUpC73VJe5lh1gexLagEa3LnXsdlwxmlnmidlfUsswcduR4HXcpPc2wfhRSLtMf26Vm000Di23hLCd-nJJscus7sT4Doj7Dp6X0fQ8WQX4zOdkUXfvT8Nhkpi5XYRTysjT_92dzjeErqSTkZaXMQl7WK_0TAAD__8jNnUw">