https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106520
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Keywords| |accepts-invalid Status|UNCONFIRMED |NEW Last reconfirmed| |2022-08-05 --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- clang diagnostic is better: <source>:15:4: error: no viable overloaded operator[] for type 'A' a[b, 2]; ~^~~~~ <source>:4:8: note: candidate function not viable: no known conversion from 'B' to 'unsigned int' for 1st argument void operator[](unsigned, unsigned); ^ <source>:3:8: note: candidate function not viable: requires 1 argument, but 2 were provided void operator[](unsigned); ^ Though it does not do the warning except for C++20.