2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / torture / pr68470.C
blobea5701aa151d792595a17802b98c942d4bdd1d5c
1 /* { dg-do compile } */
3 void deallocate(void *);
4 void *a;
6 struct C {
7     virtual void m_fn1();
8 };
10 struct D {
11     C *m_fn2() {
12         if (a)
13           __builtin_abort();
14     }   // { dg-warning "control reaches end of non-void function" }
16 D getd();
18 struct vec_int {
19     int _M_start;
20     ~vec_int() {
21         if (_M_start)
22           deallocate(&_M_start);
23     }
25 vec_int *b;
27 struct I {
28     virtual void m_fn3();
31 void I::m_fn3() {
32     if (a)
33       getd().m_fn2()->m_fn1();
34     b->~vec_int();