<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61582>61582</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Spurious -Wpre-c++2b-compat warning with -std=c++2b -pedantic
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
timsong-cpp
</td>
</tr>
</table>
<pre>
```cpp
struct A {
void operator[](int, int);
};
```
with `-std=c++2b -pedantic` (https://gcc.godbolt.org/z/qnjd5YhPa):
```
<source>:2:10: warning: overloaded 'operator[]' with more than one parameter is a C++2b extension [-Wpre-c++2b-compat]
void operator[](int, int);
^
1 warning generated.
```
I would not have expected `-pedantic` to warn me about constructs that are ill-formed in a previous standard.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycU0-PnD4M_TTmYjEKzgA7Bw4zO4v0u_2kHqoeQ-KFrCChSZjZ9tNXMPunXbU9FCFsDHn2s59VjLZ3zA2UJyjPmVrS4EOT7BS963M9z1nnzbcGKnG79TyDOIM4xhQWnfCIUJ9uEUTEi7cG_cxBJR9umEB31iWge9zMAeTL_1Cf3_1X_JfX7Xm1aUCoRB6TAXnWQCegE3WYz2yUS1ZDJRDobkhpjiCPQC1Q22u9673p_Jh2PvRA7Xeg9qt7MuWX4X-1lXD8Oc_H5PI--iVoBvkA8kggj4UAecSrCs66fnX9hcPolWGDQPVHwjVupU8-MKZBOfSOcVZBTZw4oI2o8P6NDT8ndtF6h1Ce8s9z4PyNaq79NKu0ov5Tj_H1gvLhFileaWDPbsVgs_vLDP7Dq19Gg84nHNSFkZ9n1mnlXYlf5pD8howTo-r8klB7dxNJXJuQUAVGO475ow8TG7QOFc6BL9YvEWNSzqhgdplppDnIg8q4Kar6sBd7qopsaFRhVKGp3ne1eJRSmn0pyZiyE9x1xJTZhgRJIakoZFGIYlcrrnRdHsqOy4PiCvaCJ2XH3TheplUamY1x4aYqyjvKRtXxGLdFIHJ8xe0jEK17EZr1TN4tfYS9GG1M8R0l2TRy82lewkbl9yN8a_smjT9LOlvC2HwQtE3D0u20n4DaNeuLyefgn1gnoHarNQK1G5cfAQAA__-MFCcE">