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