annotate gcc/testsuite/g++.dg/opt/ptrmem6.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // PR tree-opt/18040
kono
parents:
diff changeset
2 // { dg-do compile }
kono
parents:
diff changeset
3 // { dg-options "-O3" }
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 int PyObject_IsTrue();
kono
parents:
diff changeset
6 struct object_base
kono
parents:
diff changeset
7 {
kono
parents:
diff changeset
8 void ptr() const;
kono
parents:
diff changeset
9 void ptr1() const;
kono
parents:
diff changeset
10 };
kono
parents:
diff changeset
11 struct object : public object_base
kono
parents:
diff changeset
12 {
kono
parents:
diff changeset
13 typedef void (object::*bool_type)() const;
kono
parents:
diff changeset
14 inline operator bool_type() const
kono
parents:
diff changeset
15 { return PyObject_IsTrue()
kono
parents:
diff changeset
16 ? &object_base::ptr : &object::ptr1; }
kono
parents:
diff changeset
17 };
kono
parents:
diff changeset
18 void f();
kono
parents:
diff changeset
19 void g (void)
kono
parents:
diff changeset
20 {
kono
parents:
diff changeset
21 for (unsigned n = 0; n < 100; ++n)
kono
parents:
diff changeset
22 {
kono
parents:
diff changeset
23 object kv;
kono
parents:
diff changeset
24 if (kv)
kono
parents:
diff changeset
25 f();
kono
parents:
diff changeset
26 }
kono
parents:
diff changeset
27 }
kono
parents:
diff changeset
28