summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/temp-extend1.C
blob: 639f945657353323e6227f3dac5a0a08af9d0aa0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// PR c++/81420
// { dg-do run { target c++11 } }

int d;

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

struct B: A {};

int main()
{
  const int &r = B().i[0];
  if (d != 0)
    __builtin_abort();
}