aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/overload/defarg8.C
blob: b3ddfbb76cf4619c4162bf3ed54037d2a8845b45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// PR c++/60367
// { dg-do run { target c++11 } }

extern "C" int printf (const char *, ...);
extern "C" void abort();

void *p;
struct foo {
  foo() { p = this; }
  foo (const foo &) { abort(); }
  ~foo() { if (p != this) abort(); }
};

void do_something( foo f = {} )
{
  if (&f != p) abort();
}

int main()
{
 do_something();
}