// PR c++/19808 // { dg-do compile } // { dg-options "-Wuninitialized" } class AllocatorWithCleanup { public: int *allocate(int); }; class SecBlock { SecBlock() : m_ptr(m_alloc.allocate(0)) {} // { dg-bogus "uninitialized" } AllocatorWithCleanup m_alloc; int *m_ptr; }; struct A { int *allocate(int); }; struct B { int : 0; int *allocate(int); }; struct C : B { }; struct D { char arr[0]; int *allocate(int); }; struct E { }; struct F { E arr[10]; int *allocate(int); }; struct G { E e; int *allocate(int); }; struct H { virtual void foo (); int *allocate(int); }; template struct X { X() : m_ptr(t.allocate(0)) {} // { dg-bogus "uninitialized" } T t; int *m_ptr; }; struct V { int a; int *allocate(int); }; struct Z { Z() : m_ptr(v.allocate(0)) {} // { dg-warning "uninitialized" } V v; int *m_ptr; }; X x1; X x2; X x3; X x4; X x5; X x6; X x7;