aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nullptr10.C
blob: e27d65861ad96237b233acd5237eb8b910bb91bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// { dg-do compile { target c++11 } }

// Test arithmetic operations

void fun()
{
  nullptr = 0;         // { dg-error "lvalue required as left operand" }
  nullptr + 2;         // { dg-error "invalid operands of types " }
  decltype(nullptr) mynull = 0;
  mynull = 1;          // { dg-error "cannot convert" }
  mynull = 0;
  mynull + 2;          // { dg-error "invalid operands of types " }
}