aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nullptr20.C
blob: bbd0c7e24e3bc950c5630a47b134ac916edc94fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// { dg-do run { target c++11 } }

// Test passing to ellipisis

#include <cstdio>
#include <cstring>

int main()
{
  char buf1[64];
  char buf2[64];
  char buf3[64];

  std::sprintf(buf1, "%p", (void*)0);
  std::sprintf(buf2, "%p", nullptr);
  decltype(nullptr) mynull = 0;
  std::sprintf(buf3, "%p", nullptr);
  return std::strcmp(buf1, buf2) != 0 || std::strcmp(buf1, buf3) != 0;
}