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

int c;
int d;

struct A
{
  A() { ++c; }
  A(const A&) { ++c; }
  ~A() { ++d; }
};

A g() { return A(); }
decltype(auto) f() { return g(); }

int main()
{
  f();
  if (c < 1 || c != d)
    __builtin_abort ();
}