summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/init/new5.C
blob: 0d99f93c6348af4e13f74927370116e2c55199ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// { dg-do run }

#include <new>
    
void * operator new[](std::size_t, std::nothrow_t const &) throw()
{ return 0; }

struct X {
    struct Inner { ~Inner() {} };

    X() {
      Inner * ic = new (std::nothrow) Inner[1]; // SegFault here
    }
};

int main() {
   X table;
}