Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.old-deja/g++.jason/operator.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
4 | 4 |
5 typedef __SIZE_TYPE__ size_t; | 5 typedef __SIZE_TYPE__ size_t; |
6 | 6 |
7 struct A { | 7 struct A { |
8 int operator?:(int a, int b); // { dg-error "expected type-specifier" } | 8 int operator?:(int a, int b); // { dg-error "expected type-specifier" } |
9 static int operator()(int a); // { dg-error "must be a nonstatic member" } | 9 static int operator()(int a); // { dg-error "14:.static int A::operator\\(\\)\\(int\\). must be a nonstatic member function" } |
10 static int operator+(A,A); // { dg-error "either a non-static member" } | 10 static int operator+(A,A); // { dg-error "14:.static int A::operator\\+\\(A, A\\). must be either a non-static member function or a non-member function" } |
11 int operator+(int a, int b = 1); // { dg-error "either zero or one" } | 11 int operator+(int a, int b = 1); // { dg-error "7:.int A::operator\\+\\(int, int\\). must have either zero or one argument" } |
12 int operator++(char); // { dg-error "must take 'int'" } | 12 int operator++(char); // { dg-error "7:postfix .int A::operator\\+\\+\\(char\\). must have .int. as its argument" } |
13 void operator delete (void *); | 13 void operator delete (void *); |
14 void operator delete (void *, unsigned long); | 14 void operator delete (void *, unsigned long); |
15 }; | 15 }; |
16 | 16 |
17 struct B { | 17 struct B { |
18 void * operator new (size_t, void *); | 18 void * operator new (size_t, void *); |
19 int operator++(int = 0); | 19 int operator++(int = 0); // { dg-error "7:.int B::operator\\+\\+\\(int\\). cannot have default arguments" } |
20 int operator+ (int); | 20 int operator+ (int); |
21 void operator()(); | 21 void operator()(); |
22 char * operator[](int); | 22 char * operator[](int); |
23 B * operator->(); | 23 B * operator->(); |
24 }; | 24 }; |
25 | 25 |
26 int operator-(int a, int b); // { dg-error "argument of class or" } | 26 int operator-(int a, int b); // { dg-error "5:.int operator-\\(int, int\\). must have an argument of class or enumerated type" } |
27 | 27 |
28 void * operator new (A a); // { dg-error "first parameter" } | 28 void * operator new (A a); // { dg-error ".operator new. takes type .size_t." } |
29 void operator delete (A a); // { dg-error "first parameter" } | 29 void operator delete (A a); // { dg-error ".operator delete. takes type .void\\*. as first parameter" } |
30 | 30 |
31 char * operator char * (int); // { dg-error "return type" "ret" } | 31 char * operator char * (int); // { dg-error "return type" "ret" } |
32 // { dg-error "nonstatic member function" "mem" { target *-*-* } .-1 } | 32 // { dg-error "8:.operator char\\*\\*\\(int\\). must be a nonstatic member function" "mem" { target *-*-* } .-1 } |