Debian Codegraph @

gcc/testsuite/g++.dg/gomp/pr31769.C

raw
1 // PR tree-optimization/31769
2 // { dg-options "-O2 -fopenmp" }
3 // { dg-do compile }
4
5 struct B
6 {
7 B () {}
8 virtual ~B () {}
9 };
10 struct C
11 {
12 C (int x, int y) {}
13 };
14 template<typename T, int U>
15 struct D
16 {
17 D () {}
18 ~D () {}
19 };
20 struct E
21 {
22 E () {}
23 ~E () {}
24 D<int, 1> e;
25 };
26 struct A
27 {
28 B *b;
29 A () { b = __null; }
30 ~A () { if (b != __null) delete b; }
31 };
32 struct F : public A
33 {
34 explicit F (int x) { foo (0); }
35 F (const F &x) {}
36 F (F &x, C y) {}
37 F operator () (C x) const
38 {
39 return F (const_cast<F &>(*this), x);
40 }
41 template <typename U> F & operator+= (const U &);
42 void foo (int);
43 E f;
44 };
45
46 int
47 main ()
48 {
49 try
50 {
51 F f (10);
52 F g (10);
53 C h (0, 9);
54 #pragma omp parallel for
55 for (int i = 0; i < 2; ++i)
56 g += f (h);
57 }
58 catch (int &e)
59 {
60 }
61 }