1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9// NOTE: nullptr_t emulation (used in libc++ ABI v.1) cannot handle a
10// reinterpret_cast to an integral type
11// UNSUPPORTED: c++03
12
13// typedef decltype(nullptr) nullptr_t;
14
15
16#include <cstddef>
17#include <cassert>
18
19#include "test_macros.h"
20
21int main(int, char**)
22{
23 std::ptrdiff_t i = reinterpret_cast<std::ptrdiff_t>(nullptr);
24 assert(i == 0);
25
26 return 0;
27}
28

source code of libcxx/test/std/language.support/support.types/nullptr_t_integral_cast.pass.cpp