diff options
Diffstat (limited to 'test/language.support/support.types/nullptr_t_integral_cast.pass.cpp')
-rw-r--r-- | test/language.support/support.types/nullptr_t_integral_cast.pass.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/language.support/support.types/nullptr_t_integral_cast.pass.cpp b/test/language.support/support.types/nullptr_t_integral_cast.pass.cpp new file mode 100644 index 000000000..34c7a93e4 --- /dev/null +++ b/test/language.support/support.types/nullptr_t_integral_cast.pass.cpp @@ -0,0 +1,24 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// NOTE: nullptr_t emulation cannot handle a reinterpret_cast to an +// integral type +// XFAIL: c++98, c++03 + +// typedef decltype(nullptr) nullptr_t; + + +#include <cstddef> +#include <cassert> + +int main() +{ + std::ptrdiff_t i = reinterpret_cast<std::ptrdiff_t>(nullptr); + assert(i == 0); +} |