2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / torture / pr64280.C
blob5c569e864b4c70a311292e8d1ca146b3f2f08067
1 // { dg-do compile }
3 class A
5 public:
6   A ();
7 };
8 class B
10 public:
11   B (int);
12   operator void *() { return m_fn1 () ? 0 : this; }
13   int m_fn1 ();
15 typedef int jmp_buf[];
16 struct C
18   jmp_buf cond_;   // { dg-error "flexible array member" }
20 class F
22   C what_;
23   bool m_fn2 ();
25 int _setjmp (int[]);
26 void longjmp ();
27 class D
29 public:
30   D () { longjmp (); }
32 bool
33 F::m_fn2 ()
35   B a (0);
36   if (a)
37     if (_setjmp (what_.cond_))
38       return 0;
39     else
40       D ();
41   A b;
42 }       // { dg-warning "control reaches end of non-void function" }