aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/ext/builtin-line1.C
blob: 21a4f59a46f3393b56e9842a97a509ef8a8ff2c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// __builtin_LINE gets the location where the default argument is expanded.
// { dg-do run }

#include <cassert>
struct Foo
{
  int line;
  Foo( int line = __builtin_LINE() )
    : line( line )
  {}
};

int main()
{
  assert (Foo().line == __LINE__);
  assert ((new Foo)->line == __LINE__);
}