summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/nullptr28.C
blob: 4cc790d31b49ceb2eb90d0c131e5240ca2581181 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// { dg-do run }
// { dg-options "-std=c++0x -pedantic-errors" }

typedef decltype(nullptr) nullptr_t;

int i;
nullptr_t n;
const nullptr_t& f() { ++i; return n; }

nullptr_t g() { return f(); }

int main()
{
  g();
  if (i != 1)
    __builtin_abort ();
}