Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.bugs/900220_01.C

raw
1 // { dg-do run }
2 // g++ 1.36.1 bug 900220_01
3
4 // Ref: 12.8
5
6 // Section 12.8 says:
7
8 // "That is, X::operator=() will be generated only if no assignment
9 // operation is explicitly declared and an object of class X is actually
10 // assigned an object of class X (or an object of a class derived from X)
11 // or if the address of X::operator= is taken.
12
13 // g++ does not allow you to take the address of an implicitly generated
14 // operator=
15
16 // keywords: operator=, implicit copy operator, operator&
17
18 struct struct0 {
19 int data_member;
20 };
21
22 typedef struct0& (struct0::*member_func_t) (const struct0&);
23
24 member_func_t member_func;
25
26 void global_function_0 (member_func_t member_f)
27 { // { dg-bogus "" } ref from below
28 }
29
30 void global_function_1 ()
31 {
32 member_func = &struct0::operator=; // { dg-bogus "" }
33
34 global_function_0 (&struct0::operator=); // { dg-bogus "" }
35 }
36
37 int main () { return 0; }