Debian Codegraph @

gcc/testsuite/g++.dg/cpp23/subscript11.C

raw
1 // { dg-do compile { target c++11 } }
2 // { dg-options "" }
3
4 struct S {
5 static int &operator[] (int); // { dg-warning "may be a static member function only with" "" { target c++20_down } }
6 static int &operator[] (); // { dg-warning "may be a static member function only with" "" { target c++20_down } }
7 // { dg-error "'static int& S::operator\\\[\\\]\\\(\\\)' must have exactly one argument" "" { target c++20_down } .-1 }
8 static int &operator[] (int, int, int); // { dg-warning "may be a static member function only with" "" { target c++20_down } }
9 // { dg-error "'static int& S::operator\\\[\\\]\\\(int, int, int\\\)' must have exactly one argument" "" { target c++20_down } .-1 }
10 int s;
11 };