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

int d;

struct A
{
  int i;
  ~A() { ++d; };
};

int main()
{
  const int &r = A().i;
  if (d != 1)
    return 1;
}