diff options
Diffstat (limited to 'test/std/language.support')
53 files changed, 506 insertions, 153 deletions
diff --git a/test/std/language.support/support.dynamic/align_val_t.pass.cpp b/test/std/language.support/support.dynamic/align_val_t.pass.cpp index 0a19de919f7f..ffb54ab4d2bf 100644 --- a/test/std/language.support/support.dynamic/align_val_t.pass.cpp +++ b/test/std/language.support/support.dynamic/align_val_t.pass.cpp @@ -31,4 +31,4 @@ int main() { static_assert(b == std::align_val_t(32), ""); static_assert(static_cast<std::size_t>(c) == (std::size_t)-1, ""); } -}
\ No newline at end of file +} diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp index 36f815a819be..828feabd2127 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp @@ -36,7 +36,7 @@ #include "test_macros.h" -constexpr auto OverAligned = alignof(std::max_align_t) * 2; +constexpr auto OverAligned = __STDCPP_DEFAULT_NEW_ALIGNMENT__ * 2; int unsized_delete_called = 0; int unsized_delete_nothrow_called = 0; diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t.pass.cpp index 69f5ac8c9774..942f5e778b66 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t.pass.cpp @@ -38,7 +38,7 @@ #include "test_macros.h" -constexpr auto OverAligned = alignof(std::max_align_t) * 2; +constexpr auto OverAligned = __STDCPP_DEFAULT_NEW_ALIGNMENT__ * 2; int new_handler_called = 0; diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow.pass.cpp index 36453283caf6..f55ad5bcc84e 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow.pass.cpp @@ -37,7 +37,7 @@ #include "test_macros.h" -constexpr auto OverAligned = alignof(std::max_align_t) * 2; +constexpr auto OverAligned = __STDCPP_DEFAULT_NEW_ALIGNMENT__ * 2; int new_handler_called = 0; diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow_replace.pass.cpp index 228d176a27e0..e1ebf86ee176 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow_replace.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow_replace.pass.cpp @@ -34,7 +34,7 @@ #include "test_macros.h" -constexpr auto OverAligned = alignof(std::max_align_t) * 2; +constexpr auto OverAligned = __STDCPP_DEFAULT_NEW_ALIGNMENT__ * 2; int A_constructed = 0; diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_replace.pass.cpp index 15bebcbcbcb8..82dc77efe89e 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_replace.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_replace.pass.cpp @@ -24,7 +24,7 @@ #include "test_macros.h" -constexpr auto OverAligned = alignof(std::max_align_t) * 2; +constexpr auto OverAligned = __STDCPP_DEFAULT_NEW_ALIGNMENT__ * 2; int A_constructed = 0; diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp index 53e26c99f92e..ba3f930c5f14 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp @@ -10,6 +10,7 @@ // test operator new [] nothrow by replacing only operator new // UNSUPPORTED: sanitizer-new-delete +// XFAIL: libcpp-no-vcruntime #include <new> #include <cstddef> diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp index b0820b14f410..3f8122745cc4 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp @@ -10,6 +10,7 @@ // test operator new[] replacement by replacing only operator new // UNSUPPORTED: sanitizer-new-delete +// XFAIL: libcpp-no-vcruntime #include <new> diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size.fail.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size.fail.cpp new file mode 100644 index 000000000000..0dfef2e56fca --- /dev/null +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size.fail.cpp @@ -0,0 +1,25 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <new> + +// void* operator new[](std::size_t); + +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 +// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8 + +#include <new> + +#include "test_macros.h" + +int main () +{ + ::operator new[](4); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}} +} diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align.fail.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align.fail.cpp new file mode 100644 index 000000000000..ea041aea16ee --- /dev/null +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align.fail.cpp @@ -0,0 +1,25 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <new> + +// void* operator new[](std::size_t, std::align_val_t); + +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 +// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8 + +#include <new> + +#include "test_macros.h" + +int main () +{ + ::operator new[](4, std::align_val_t{4}); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}} +} diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align_nothrow.fail.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align_nothrow.fail.cpp new file mode 100644 index 000000000000..99e4f76b312f --- /dev/null +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align_nothrow.fail.cpp @@ -0,0 +1,25 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <new> + +// void* operator new[](std::size_t, std::align_val_t, std::nothrow_t &); + +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 +// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8 + +#include <new> + +#include "test_macros.h" + +int main () +{ + ::operator new[](4, std::align_val_t{4}, std::nothrow); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}} +} diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_nothrow.fail.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_nothrow.fail.cpp new file mode 100644 index 000000000000..8aae54e83fbe --- /dev/null +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_nothrow.fail.cpp @@ -0,0 +1,25 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <new> + +// void* operator new[](std::size_t, std::nothrow_t &); + +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 +// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8 + +#include <new> + +#include "test_macros.h" + +int main () +{ + ::operator new[](4, std::nothrow); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}} +} diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array11.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array11.pass.cpp index 3e41b24d292f..862318d0be7b 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array11.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array11.pass.cpp @@ -12,7 +12,7 @@ // Note that sized delete operator definitions below are simply ignored // when sized deallocation is not supported, e.g., prior to C++14. -// UNSUPPORTED: c++14, c++1z +// UNSUPPORTED: c++14, c++17 // UNSUPPORTED: sanitizer-new-delete #include <new> diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array14.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array14.pass.cpp index fb715805083f..d0b7405453cd 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array14.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array14.pass.cpp @@ -11,12 +11,12 @@ // UNSUPPORTED: sanitizer-new-delete, c++98, c++03, c++11 -// NOTE: Clang does not enable sized-deallocation in c++14 and beyond by +// NOTE: Clang does not enable sized-deallocation in C++14 and beyond by // default. It is only enabled when -fsized-deallocation is given. // (except clang-3.6 which temporarily enabled sized-deallocation) // UNSUPPORTED: clang, apple-clang -// NOTE: GCC 4.9.1 does not support sized-deallocation in c++14. However +// NOTE: GCC 4.9.1 does not support sized-deallocation in C++14. However // GCC 5.1 does. // XFAIL: gcc-4.7, gcc-4.8, gcc-4.9 diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_array_ptr.fail.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_array_ptr.fail.cpp new file mode 100644 index 000000000000..83d5e80e87e4 --- /dev/null +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_array_ptr.fail.cpp @@ -0,0 +1,26 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <new> + +// void* operator new[](std::size_t, void *); + +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 +// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8 + +#include <new> + +#include "test_macros.h" + +int main () +{ + char buffer[100]; + ::operator new[](4, buffer); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}} +} diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_ptr.fail.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_ptr.fail.cpp new file mode 100644 index 000000000000..9d3892cb0a81 --- /dev/null +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_ptr.fail.cpp @@ -0,0 +1,26 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <new> + +// void* operator new(std::size_t, void *); + +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 +// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8 + +#include <new> + +#include "test_macros.h" + +int main () +{ + char buffer[100]; + ::operator new(4, buffer); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}} +} diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp index b0e932c96cb0..d64a633007e7 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp @@ -35,7 +35,7 @@ #include "test_macros.h" -constexpr auto OverAligned = alignof(std::max_align_t) * 2; +constexpr auto OverAligned = __STDCPP_DEFAULT_NEW_ALIGNMENT__ * 2; int unsized_delete_called = 0; int unsized_delete_nothrow_called = 0; diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t.pass.cpp index 22ea5e2fff89..fae5d3676df6 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t.pass.cpp @@ -37,7 +37,7 @@ #include "test_macros.h" -constexpr auto OverAligned = alignof(std::max_align_t) * 2; +constexpr auto OverAligned = __STDCPP_DEFAULT_NEW_ALIGNMENT__ * 2; int new_handler_called = 0; diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow.pass.cpp index 2c5c0f80b839..f22c48994355 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow.pass.cpp @@ -37,7 +37,7 @@ #include "test_macros.h" -constexpr auto OverAligned = alignof(std::max_align_t) * 2; +constexpr auto OverAligned = __STDCPP_DEFAULT_NEW_ALIGNMENT__ * 2; int new_handler_called = 0; diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow_replace.pass.cpp index b50f49dc6ca7..565ba9b851bb 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow_replace.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow_replace.pass.cpp @@ -35,7 +35,7 @@ #include "test_macros.h" -constexpr auto OverAligned = alignof(std::max_align_t) * 2; +constexpr auto OverAligned = __STDCPP_DEFAULT_NEW_ALIGNMENT__ * 2; bool A_constructed = false; diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_replace.pass.cpp index 66bb613adfd0..bace5c036e0c 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_replace.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_replace.pass.cpp @@ -24,7 +24,7 @@ #include "test_macros.h" -constexpr auto OverAligned = alignof(std::max_align_t) * 2; +constexpr auto OverAligned = __STDCPP_DEFAULT_NEW_ALIGNMENT__ * 2; bool A_constructed = false; diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow_replace.pass.cpp index dbc64bace332..31e1901511fa 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow_replace.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow_replace.pass.cpp @@ -10,6 +10,7 @@ // test operator new nothrow by replacing only operator new // UNSUPPORTED: sanitizer-new-delete +// XFAIL: libcpp-no-vcruntime #include <new> #include <cstddef> diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size.fail.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size.fail.cpp new file mode 100644 index 000000000000..865cb1ee8375 --- /dev/null +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size.fail.cpp @@ -0,0 +1,25 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <new> + +// void* operator new(std::size_t); + +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 +// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8 + +#include <new> + +#include "test_macros.h" + +int main () +{ + ::operator new(4); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}} +} diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align.fail.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align.fail.cpp new file mode 100644 index 000000000000..c3cabbdb79d5 --- /dev/null +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align.fail.cpp @@ -0,0 +1,25 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <new> + +// void* operator new(std::size_t, std::align_val_t); + +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 +// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8 + +#include <new> + +#include "test_macros.h" + +int main () +{ + ::operator new(4, std::align_val_t{4}); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}} +} diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.fail.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.fail.cpp new file mode 100644 index 000000000000..e987a53478b0 --- /dev/null +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.fail.cpp @@ -0,0 +1,25 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <new> + +// void* operator new(std::size_t, std::align_val_t, std::nothrow_t &); + +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 +// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8 + +#include <new> + +#include "test_macros.h" + +int main () +{ + ::operator new(4, std::align_val_t{4}, std::nothrow); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}} +} diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_nothrow.fail.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_nothrow.fail.cpp new file mode 100644 index 000000000000..39392691e9bc --- /dev/null +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_nothrow.fail.cpp @@ -0,0 +1,25 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <new> + +// void* operator new(std::size_t, std::nothrow_t &); + +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 +// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8 + +#include <new> + +#include "test_macros.h" + +int main () +{ + ::operator new(4, std::nothrow); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}} +} diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete11.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete11.pass.cpp index 57fb1eb88b6e..945bf779a893 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete11.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete11.pass.cpp @@ -12,7 +12,7 @@ // Note that sized delete operator definitions below are simply ignored // when sized deallocation is not supported, e.g., prior to C++14. -// UNSUPPORTED: c++14, c++1z +// UNSUPPORTED: c++14, c++17 // UNSUPPORTED: sanitizer-new-delete #include <new> diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp index b85b670fa2d4..7a76725a9751 100644 --- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp +++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete14.pass.cpp @@ -11,12 +11,12 @@ // UNSUPPORTED: sanitizer-new-delete, c++98, c++03, c++11 -// NOTE: Clang does not enable sized-deallocation in c++14 and beyond by +// NOTE: Clang does not enable sized-deallocation in C++14 and beyond by // default. It is only enabled when -fsized-deallocation is given. // (except clang-3.6 which temporarily enabled sized-deallocation) // UNSUPPORTED: clang, apple-clang -// NOTE: GCC 4.9.1 does not support sized-deallocation in c++14. However +// NOTE: GCC 4.9.1 does not support sized-deallocation in C++14. However // GCC 5.1 does. // XFAIL: gcc-4.7, gcc-4.8, gcc-4.9 diff --git a/test/std/language.support/support.dynamic/ptr.launder/launder.nodiscard.fail.cpp b/test/std/language.support/support.dynamic/ptr.launder/launder.nodiscard.fail.cpp new file mode 100644 index 000000000000..1c75e561d7c7 --- /dev/null +++ b/test/std/language.support/support.dynamic/ptr.launder/launder.nodiscard.fail.cpp @@ -0,0 +1,27 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <new> + +// template <class T> constexpr T* launder(T* p) noexcept; + +// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 +// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8 + +#include <new> +#include <cassert> + +#include "test_macros.h" + +int main () +{ + int *p = nullptr; + std::launder(p); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}} +} diff --git a/test/std/language.support/support.dynamic/ptr.launder/launder.pass.cpp b/test/std/language.support/support.dynamic/ptr.launder/launder.pass.cpp new file mode 100644 index 000000000000..1aa462957c8b --- /dev/null +++ b/test/std/language.support/support.dynamic/ptr.launder/launder.pass.cpp @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <new> + +// template <class T> constexpr T* launder(T* p) noexcept; + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +#include <new> +#include <cassert> + +#include "test_macros.h" + +constexpr int gi = 5; +constexpr float gf = 8.f; + +int main() { + static_assert(std::launder(&gi) == &gi, "" ); + static_assert(std::launder(&gf) == &gf, "" ); + + const int *i = &gi; + const float *f = &gf; + static_assert(std::is_same<decltype(i), decltype(std::launder(i))>::value, ""); + static_assert(std::is_same<decltype(f), decltype(std::launder(f))>::value, ""); + + assert(std::launder(i) == i); + assert(std::launder(f) == f); +} diff --git a/test/std/language.support/support.dynamic/ptr.launder/launder.types.fail.cpp b/test/std/language.support/support.dynamic/ptr.launder/launder.types.fail.cpp new file mode 100644 index 000000000000..71f5e4588b82 --- /dev/null +++ b/test/std/language.support/support.dynamic/ptr.launder/launder.types.fail.cpp @@ -0,0 +1,34 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <new> + +// template <class T> constexpr T* launder(T* p) noexcept; +// The program is ill-formed if T is a function type or cv void. + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +#include <new> +#include <cassert> + +#include "test_macros.h" + +void foo() {} + +int main () +{ + void *p = nullptr; + (void) std::launder(( void *) nullptr); + (void) std::launder((const void *) nullptr); + (void) std::launder(( volatile void *) nullptr); + (void) std::launder((const volatile void *) nullptr); // expected-error-re@new:* 4 {{static_assert failed{{.*}} "can't launder cv-void"}} + + (void) std::launder(foo); // expected-error-re@new:* 1 {{static_assert failed{{.*}} "can't launder functions"}} +} diff --git a/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp b/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp index 88e2253d08c7..43a11bab3fde 100644 --- a/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp +++ b/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp @@ -46,8 +46,8 @@ public: class C { public: - virtual ~C() {} - C * operator&() const { assert(false); return nullptr; } // should not be called + virtual ~C() {} + C * operator&() const { assert(false); return nullptr; } // should not be called }; class D : private std::nested_exception {}; diff --git a/test/std/language.support/support.initlist/support.initlist.access/access.pass.cpp b/test/std/language.support/support.initlist/support.initlist.access/access.pass.cpp index f6fd5564f55f..cadae24cb77f 100644 --- a/test/std/language.support/support.initlist/support.initlist.access/access.pass.cpp +++ b/test/std/language.support/support.initlist/support.initlist.access/access.pass.cpp @@ -57,5 +57,6 @@ int main() A test1 = {3, 2, 1}; #if TEST_STD_VER > 11 constexpr B test2 = {3, 2, 1}; + (void)test2; #endif // TEST_STD_VER > 11 } diff --git a/test/std/language.support/support.initlist/support.initlist.range/begin_end.pass.cpp b/test/std/language.support/support.initlist/support.initlist.range/begin_end.pass.cpp index 102ed64fef9b..abb07dc99772 100644 --- a/test/std/language.support/support.initlist/support.initlist.range/begin_end.pass.cpp +++ b/test/std/language.support/support.initlist/support.initlist.range/begin_end.pass.cpp @@ -55,5 +55,6 @@ int main() A test1 = {3, 2, 1}; #if TEST_STD_VER > 11 constexpr B test2 = {3, 2, 1}; + (void)test2; #endif // TEST_STD_VER > 11 } diff --git a/test/std/language.support/support.limits/limits/numeric.limits.members/const_data_members.pass.cpp b/test/std/language.support/support.limits/limits/numeric.limits.members/const_data_members.pass.cpp index 50cfc4674251..6a46c370e750 100644 --- a/test/std/language.support/support.limits/limits/numeric.limits.members/const_data_members.pass.cpp +++ b/test/std/language.support/support.limits/limits/numeric.limits.members/const_data_members.pass.cpp @@ -37,8 +37,8 @@ round_style */ -template <class _Tp> -void test(const _Tp &) {} +template <class T> +void test(const T &) {} #define TEST_NUMERIC_LIMITS(type) \ test(std::numeric_limits<type>::is_specialized); \ diff --git a/test/std/language.support/support.types/byteops/and.assign.pass.cpp b/test/std/language.support/support.types/byteops/and.assign.pass.cpp index ec1c3805a6cb..4aea7909dfaa 100644 --- a/test/std/language.support/support.types/byteops/and.assign.pass.cpp +++ b/test/std/language.support/support.types/byteops/and.assign.pass.cpp @@ -16,24 +16,24 @@ constexpr std::byte test(std::byte b1, std::byte b2) { - std::byte bret = b1; - return bret &= b2; - } + std::byte bret = b1; + return bret &= b2; + } int main () { - std::byte b; // not constexpr, just used in noexcept check - constexpr std::byte b1{static_cast<std::byte>(1)}; - constexpr std::byte b8{static_cast<std::byte>(8)}; - constexpr std::byte b9{static_cast<std::byte>(9)}; + std::byte b; // not constexpr, just used in noexcept check + constexpr std::byte b1{static_cast<std::byte>(1)}; + constexpr std::byte b8{static_cast<std::byte>(8)}; + constexpr std::byte b9{static_cast<std::byte>(9)}; - static_assert(noexcept(b &= b), "" ); + static_assert(noexcept(b &= b), "" ); - static_assert(std::to_integer<int>(test(b1, b8)) == 0, ""); - static_assert(std::to_integer<int>(test(b1, b9)) == 1, ""); - static_assert(std::to_integer<int>(test(b8, b9)) == 8, ""); + static_assert(std::to_integer<int>(test(b1, b8)) == 0, ""); + static_assert(std::to_integer<int>(test(b1, b9)) == 1, ""); + static_assert(std::to_integer<int>(test(b8, b9)) == 8, ""); - static_assert(std::to_integer<int>(test(b8, b1)) == 0, ""); - static_assert(std::to_integer<int>(test(b9, b1)) == 1, ""); - static_assert(std::to_integer<int>(test(b9, b8)) == 8, ""); + static_assert(std::to_integer<int>(test(b8, b1)) == 0, ""); + static_assert(std::to_integer<int>(test(b9, b1)) == 1, ""); + static_assert(std::to_integer<int>(test(b9, b8)) == 8, ""); } diff --git a/test/std/language.support/support.types/byteops/and.pass.cpp b/test/std/language.support/support.types/byteops/and.pass.cpp index 6c5419cfc2a2..32c0bdaee842 100644 --- a/test/std/language.support/support.types/byteops/and.pass.cpp +++ b/test/std/language.support/support.types/byteops/and.pass.cpp @@ -15,17 +15,17 @@ // constexpr byte operator&(byte l, byte r) noexcept; int main () { - constexpr std::byte b1{static_cast<std::byte>(1)}; - constexpr std::byte b8{static_cast<std::byte>(8)}; - constexpr std::byte b9{static_cast<std::byte>(9)}; + constexpr std::byte b1{static_cast<std::byte>(1)}; + constexpr std::byte b8{static_cast<std::byte>(8)}; + constexpr std::byte b9{static_cast<std::byte>(9)}; - static_assert(noexcept(b1 & b8), "" ); + static_assert(noexcept(b1 & b8), "" ); - static_assert(std::to_integer<int>(b1 & b8) == 0, ""); - static_assert(std::to_integer<int>(b1 & b9) == 1, ""); - static_assert(std::to_integer<int>(b8 & b9) == 8, ""); + static_assert(std::to_integer<int>(b1 & b8) == 0, ""); + static_assert(std::to_integer<int>(b1 & b9) == 1, ""); + static_assert(std::to_integer<int>(b8 & b9) == 8, ""); - static_assert(std::to_integer<int>(b8 & b1) == 0, ""); - static_assert(std::to_integer<int>(b9 & b1) == 1, ""); - static_assert(std::to_integer<int>(b9 & b8) == 8, ""); + static_assert(std::to_integer<int>(b8 & b1) == 0, ""); + static_assert(std::to_integer<int>(b9 & b1) == 1, ""); + static_assert(std::to_integer<int>(b9 & b8) == 8, ""); } diff --git a/test/std/language.support/support.types/byteops/lshift.assign.fail.cpp b/test/std/language.support/support.types/byteops/lshift.assign.fail.cpp index 8f6822932ac2..66946b4647bd 100644 --- a/test/std/language.support/support.types/byteops/lshift.assign.fail.cpp +++ b/test/std/language.support/support.types/byteops/lshift.assign.fail.cpp @@ -22,10 +22,10 @@ constexpr std::byte test(std::byte b) { - return b <<= 2.0; - } + return b <<= 2.0; + } int main () { - constexpr std::byte b1 = test(std::byte{1}); + constexpr std::byte b1 = test(std::byte{1}); } diff --git a/test/std/language.support/support.types/byteops/lshift.assign.pass.cpp b/test/std/language.support/support.types/byteops/lshift.assign.pass.cpp index abfeebf2b024..6883dccfb993 100644 --- a/test/std/language.support/support.types/byteops/lshift.assign.pass.cpp +++ b/test/std/language.support/support.types/byteops/lshift.assign.pass.cpp @@ -19,18 +19,18 @@ constexpr std::byte test(std::byte b) { - return b <<= 2; - } + return b <<= 2; + } int main () { - std::byte b; // not constexpr, just used in noexcept check - constexpr std::byte b2{static_cast<std::byte>(2)}; - constexpr std::byte b3{static_cast<std::byte>(3)}; + std::byte b; // not constexpr, just used in noexcept check + constexpr std::byte b2{static_cast<std::byte>(2)}; + constexpr std::byte b3{static_cast<std::byte>(3)}; - static_assert(noexcept(b <<= 2), "" ); + static_assert(noexcept(b <<= 2), "" ); - static_assert(std::to_integer<int>(test(b2)) == 8, "" ); - static_assert(std::to_integer<int>(test(b3)) == 12, "" ); + static_assert(std::to_integer<int>(test(b2)) == 8, "" ); + static_assert(std::to_integer<int>(test(b3)) == 12, "" ); } diff --git a/test/std/language.support/support.types/byteops/lshift.fail.cpp b/test/std/language.support/support.types/byteops/lshift.fail.cpp index 707258c6df30..c213935912c2 100644 --- a/test/std/language.support/support.types/byteops/lshift.fail.cpp +++ b/test/std/language.support/support.types/byteops/lshift.fail.cpp @@ -18,6 +18,6 @@ // is_integral_v<IntegerType> is true. int main () { - constexpr std::byte b1{static_cast<std::byte>(1)}; - constexpr std::byte b2 = b1 << 2.0f; + constexpr std::byte b1{static_cast<std::byte>(1)}; + constexpr std::byte b2 = b1 << 2.0f; } diff --git a/test/std/language.support/support.types/byteops/lshift.pass.cpp b/test/std/language.support/support.types/byteops/lshift.pass.cpp index 15ad796cbe9e..a1731b9904cc 100644 --- a/test/std/language.support/support.types/byteops/lshift.pass.cpp +++ b/test/std/language.support/support.types/byteops/lshift.pass.cpp @@ -18,13 +18,13 @@ // is_integral_v<IntegerType> is true. int main () { - constexpr std::byte b1{static_cast<std::byte>(1)}; - constexpr std::byte b3{static_cast<std::byte>(3)}; + constexpr std::byte b1{static_cast<std::byte>(1)}; + constexpr std::byte b3{static_cast<std::byte>(3)}; - static_assert(noexcept(b3 << 2), "" ); + static_assert(noexcept(b3 << 2), "" ); - static_assert(std::to_integer<int>(b1 << 1) == 2, ""); - static_assert(std::to_integer<int>(b1 << 2) == 4, ""); - static_assert(std::to_integer<int>(b3 << 4) == 48, ""); - static_assert(std::to_integer<int>(b3 << 6) == 192, ""); + static_assert(std::to_integer<int>(b1 << 1) == 2, ""); + static_assert(std::to_integer<int>(b1 << 2) == 4, ""); + static_assert(std::to_integer<int>(b3 << 4) == 48, ""); + static_assert(std::to_integer<int>(b3 << 6) == 192, ""); } diff --git a/test/std/language.support/support.types/byteops/not.pass.cpp b/test/std/language.support/support.types/byteops/not.pass.cpp index 53f1d91faf23..2629001e96a2 100644 --- a/test/std/language.support/support.types/byteops/not.pass.cpp +++ b/test/std/language.support/support.types/byteops/not.pass.cpp @@ -15,13 +15,13 @@ // constexpr byte operator~(byte b) noexcept; int main () { - constexpr std::byte b1{static_cast<std::byte>(1)}; - constexpr std::byte b2{static_cast<std::byte>(2)}; - constexpr std::byte b8{static_cast<std::byte>(8)}; + constexpr std::byte b1{static_cast<std::byte>(1)}; + constexpr std::byte b2{static_cast<std::byte>(2)}; + constexpr std::byte b8{static_cast<std::byte>(8)}; - static_assert(noexcept(~b1), "" ); + static_assert(noexcept(~b1), "" ); - static_assert(std::to_integer<int>(~b1) == 254, ""); - static_assert(std::to_integer<int>(~b2) == 253, ""); - static_assert(std::to_integer<int>(~b8) == 247, ""); + static_assert(std::to_integer<int>(~b1) == 254, ""); + static_assert(std::to_integer<int>(~b2) == 253, ""); + static_assert(std::to_integer<int>(~b8) == 247, ""); } diff --git a/test/std/language.support/support.types/byteops/or.assign.pass.cpp b/test/std/language.support/support.types/byteops/or.assign.pass.cpp index bb4a84ec6c76..0cceeaaece15 100644 --- a/test/std/language.support/support.types/byteops/or.assign.pass.cpp +++ b/test/std/language.support/support.types/byteops/or.assign.pass.cpp @@ -16,25 +16,25 @@ constexpr std::byte test(std::byte b1, std::byte b2) { - std::byte bret = b1; - return bret |= b2; - } + std::byte bret = b1; + return bret |= b2; + } int main () { - std::byte b; // not constexpr, just used in noexcept check - constexpr std::byte b1{static_cast<std::byte>(1)}; - constexpr std::byte b2{static_cast<std::byte>(2)}; - constexpr std::byte b8{static_cast<std::byte>(8)}; + std::byte b; // not constexpr, just used in noexcept check + constexpr std::byte b1{static_cast<std::byte>(1)}; + constexpr std::byte b2{static_cast<std::byte>(2)}; + constexpr std::byte b8{static_cast<std::byte>(8)}; - static_assert(noexcept(b |= b), "" ); + static_assert(noexcept(b |= b), "" ); - static_assert(std::to_integer<int>(test(b1, b2)) == 3, ""); - static_assert(std::to_integer<int>(test(b1, b8)) == 9, ""); - static_assert(std::to_integer<int>(test(b2, b8)) == 10, ""); + static_assert(std::to_integer<int>(test(b1, b2)) == 3, ""); + static_assert(std::to_integer<int>(test(b1, b8)) == 9, ""); + static_assert(std::to_integer<int>(test(b2, b8)) == 10, ""); - static_assert(std::to_integer<int>(test(b2, b1)) == 3, ""); - static_assert(std::to_integer<int>(test(b8, b1)) == 9, ""); - static_assert(std::to_integer<int>(test(b8, b2)) == 10, ""); + static_assert(std::to_integer<int>(test(b2, b1)) == 3, ""); + static_assert(std::to_integer<int>(test(b8, b1)) == 9, ""); + static_assert(std::to_integer<int>(test(b8, b2)) == 10, ""); } diff --git a/test/std/language.support/support.types/byteops/or.pass.cpp b/test/std/language.support/support.types/byteops/or.pass.cpp index e2b734982c09..62260f27bd24 100644 --- a/test/std/language.support/support.types/byteops/or.pass.cpp +++ b/test/std/language.support/support.types/byteops/or.pass.cpp @@ -15,17 +15,17 @@ // constexpr byte operator|(byte l, byte r) noexcept; int main () { - constexpr std::byte b1{static_cast<std::byte>(1)}; - constexpr std::byte b2{static_cast<std::byte>(2)}; - constexpr std::byte b8{static_cast<std::byte>(8)}; + constexpr std::byte b1{static_cast<std::byte>(1)}; + constexpr std::byte b2{static_cast<std::byte>(2)}; + constexpr std::byte b8{static_cast<std::byte>(8)}; - static_assert(noexcept(b1 | b2), "" ); + static_assert(noexcept(b1 | b2), "" ); - static_assert(std::to_integer<int>(b1 | b2) == 3, ""); - static_assert(std::to_integer<int>(b1 | b8) == 9, ""); - static_assert(std::to_integer<int>(b2 | b8) == 10, ""); + static_assert(std::to_integer<int>(b1 | b2) == 3, ""); + static_assert(std::to_integer<int>(b1 | b8) == 9, ""); + static_assert(std::to_integer<int>(b2 | b8) == 10, ""); - static_assert(std::to_integer<int>(b2 | b1) == 3, ""); - static_assert(std::to_integer<int>(b8 | b1) == 9, ""); - static_assert(std::to_integer<int>(b8 | b2) == 10, ""); + static_assert(std::to_integer<int>(b2 | b1) == 3, ""); + static_assert(std::to_integer<int>(b8 | b1) == 9, ""); + static_assert(std::to_integer<int>(b8 | b2) == 10, ""); } diff --git a/test/std/language.support/support.types/byteops/rshift.assign.fail.cpp b/test/std/language.support/support.types/byteops/rshift.assign.fail.cpp index 44992fa98c33..80f0bd7bcf59 100644 --- a/test/std/language.support/support.types/byteops/rshift.assign.fail.cpp +++ b/test/std/language.support/support.types/byteops/rshift.assign.fail.cpp @@ -22,10 +22,10 @@ constexpr std::byte test(std::byte b) { - return b >>= 2.0; - } + return b >>= 2.0; + } int main () { - constexpr std::byte b1 = test(std::byte{1}); + constexpr std::byte b1 = test(std::byte{1}); } diff --git a/test/std/language.support/support.types/byteops/rshift.assign.pass.cpp b/test/std/language.support/support.types/byteops/rshift.assign.pass.cpp index 82c611cfdfcb..6763995f6d42 100644 --- a/test/std/language.support/support.types/byteops/rshift.assign.pass.cpp +++ b/test/std/language.support/support.types/byteops/rshift.assign.pass.cpp @@ -19,17 +19,17 @@ constexpr std::byte test(std::byte b) { - return b >>= 2; - } + return b >>= 2; + } int main () { - std::byte b; // not constexpr, just used in noexcept check - constexpr std::byte b16{static_cast<std::byte>(16)}; - constexpr std::byte b192{static_cast<std::byte>(192)}; + std::byte b; // not constexpr, just used in noexcept check + constexpr std::byte b16{static_cast<std::byte>(16)}; + constexpr std::byte b192{static_cast<std::byte>(192)}; - static_assert(noexcept(b >>= 2), "" ); + static_assert(noexcept(b >>= 2), "" ); - static_assert(std::to_integer<int>(test(b16)) == 4, "" ); - static_assert(std::to_integer<int>(test(b192)) == 48, "" ); + static_assert(std::to_integer<int>(test(b16)) == 4, "" ); + static_assert(std::to_integer<int>(test(b192)) == 48, "" ); } diff --git a/test/std/language.support/support.types/byteops/rshift.fail.cpp b/test/std/language.support/support.types/byteops/rshift.fail.cpp index 8e142dd90a5c..b78af2eb260f 100644 --- a/test/std/language.support/support.types/byteops/rshift.fail.cpp +++ b/test/std/language.support/support.types/byteops/rshift.fail.cpp @@ -18,6 +18,6 @@ // is_integral_v<IntegerType> is true. int main () { - constexpr std::byte b1{static_cast<std::byte>(1)}; - constexpr std::byte b2 = b1 >> 2.0f; + constexpr std::byte b1{static_cast<std::byte>(1)}; + constexpr std::byte b2 = b1 >> 2.0f; } diff --git a/test/std/language.support/support.types/byteops/rshift.pass.cpp b/test/std/language.support/support.types/byteops/rshift.pass.cpp index 22d399130bbc..eec3ad6839b4 100644 --- a/test/std/language.support/support.types/byteops/rshift.pass.cpp +++ b/test/std/language.support/support.types/byteops/rshift.pass.cpp @@ -19,19 +19,19 @@ constexpr std::byte test(std::byte b) { - return b <<= 2; - } + return b <<= 2; + } int main () { - constexpr std::byte b100{static_cast<std::byte>(100)}; - constexpr std::byte b115{static_cast<std::byte>(115)}; + constexpr std::byte b100{static_cast<std::byte>(100)}; + constexpr std::byte b115{static_cast<std::byte>(115)}; - static_assert(noexcept(b100 << 2), "" ); + static_assert(noexcept(b100 << 2), "" ); - static_assert(std::to_integer<int>(b100 >> 1) == 50, ""); - static_assert(std::to_integer<int>(b100 >> 2) == 25, ""); - static_assert(std::to_integer<int>(b115 >> 3) == 14, ""); - static_assert(std::to_integer<int>(b115 >> 6) == 1, ""); + static_assert(std::to_integer<int>(b100 >> 1) == 50, ""); + static_assert(std::to_integer<int>(b100 >> 2) == 25, ""); + static_assert(std::to_integer<int>(b115 >> 3) == 14, ""); + static_assert(std::to_integer<int>(b115 >> 6) == 1, ""); } diff --git a/test/std/language.support/support.types/byteops/to_integer.fail.cpp b/test/std/language.support/support.types/byteops/to_integer.fail.cpp index fb4928956f55..86f2ad95bf17 100644 --- a/test/std/language.support/support.types/byteops/to_integer.fail.cpp +++ b/test/std/language.support/support.types/byteops/to_integer.fail.cpp @@ -18,6 +18,6 @@ // is_integral_v<IntegerType> is true. int main () { - constexpr std::byte b1{static_cast<std::byte>(1)}; - auto f = std::to_integer<float>(b1); + constexpr std::byte b1{static_cast<std::byte>(1)}; + auto f = std::to_integer<float>(b1); } diff --git a/test/std/language.support/support.types/byteops/to_integer.pass.cpp b/test/std/language.support/support.types/byteops/to_integer.pass.cpp index 4f34363447f6..065e6d1278ad 100644 --- a/test/std/language.support/support.types/byteops/to_integer.pass.cpp +++ b/test/std/language.support/support.types/byteops/to_integer.pass.cpp @@ -18,14 +18,14 @@ // is_integral_v<IntegerType> is true. int main () { - constexpr std::byte b1{static_cast<std::byte>(1)}; - constexpr std::byte b3{static_cast<std::byte>(3)}; + constexpr std::byte b1{static_cast<std::byte>(1)}; + constexpr std::byte b3{static_cast<std::byte>(3)}; - static_assert(noexcept(std::to_integer<int>(b1)), "" ); - static_assert(std::is_same<int, decltype(std::to_integer<int>(b1))>::value, "" ); - static_assert(std::is_same<long, decltype(std::to_integer<long>(b1))>::value, "" ); - static_assert(std::is_same<unsigned short, decltype(std::to_integer<unsigned short>(b1))>::value, "" ); + static_assert(noexcept(std::to_integer<int>(b1)), "" ); + static_assert(std::is_same<int, decltype(std::to_integer<int>(b1))>::value, "" ); + static_assert(std::is_same<long, decltype(std::to_integer<long>(b1))>::value, "" ); + static_assert(std::is_same<unsigned short, decltype(std::to_integer<unsigned short>(b1))>::value, "" ); - static_assert(std::to_integer<int>(b1) == 1, ""); - static_assert(std::to_integer<int>(b3) == 3, ""); + static_assert(std::to_integer<int>(b1) == 1, ""); + static_assert(std::to_integer<int>(b3) == 3, ""); } diff --git a/test/std/language.support/support.types/byteops/xor.assign.pass.cpp b/test/std/language.support/support.types/byteops/xor.assign.pass.cpp index 6a526da3d714..07727ec9eb1c 100644 --- a/test/std/language.support/support.types/byteops/xor.assign.pass.cpp +++ b/test/std/language.support/support.types/byteops/xor.assign.pass.cpp @@ -16,24 +16,24 @@ constexpr std::byte test(std::byte b1, std::byte b2) { - std::byte bret = b1; - return bret ^= b2; - } + std::byte bret = b1; + return bret ^= b2; + } int main () { - std::byte b; // not constexpr, just used in noexcept check - constexpr std::byte b1{static_cast<std::byte>(1)}; - constexpr std::byte b8{static_cast<std::byte>(8)}; - constexpr std::byte b9{static_cast<std::byte>(9)}; + std::byte b; // not constexpr, just used in noexcept check + constexpr std::byte b1{static_cast<std::byte>(1)}; + constexpr std::byte b8{static_cast<std::byte>(8)}; + constexpr std::byte b9{static_cast<std::byte>(9)}; - static_assert(noexcept(b ^= b), "" ); + static_assert(noexcept(b ^= b), "" ); - static_assert(std::to_integer<int>(test(b1, b8)) == 9, ""); - static_assert(std::to_integer<int>(test(b1, b9)) == 8, ""); - static_assert(std::to_integer<int>(test(b8, b9)) == 1, ""); + static_assert(std::to_integer<int>(test(b1, b8)) == 9, ""); + static_assert(std::to_integer<int>(test(b1, b9)) == 8, ""); + static_assert(std::to_integer<int>(test(b8, b9)) == 1, ""); - static_assert(std::to_integer<int>(test(b8, b1)) == 9, ""); - static_assert(std::to_integer<int>(test(b9, b1)) == 8, ""); - static_assert(std::to_integer<int>(test(b9, b8)) == 1, ""); + static_assert(std::to_integer<int>(test(b8, b1)) == 9, ""); + static_assert(std::to_integer<int>(test(b9, b1)) == 8, ""); + static_assert(std::to_integer<int>(test(b9, b8)) == 1, ""); } diff --git a/test/std/language.support/support.types/byteops/xor.pass.cpp b/test/std/language.support/support.types/byteops/xor.pass.cpp index e8c3b9875785..d7e18c91b044 100644 --- a/test/std/language.support/support.types/byteops/xor.pass.cpp +++ b/test/std/language.support/support.types/byteops/xor.pass.cpp @@ -15,17 +15,17 @@ // constexpr byte operator^(byte l, byte r) noexcept; int main () { - constexpr std::byte b1{static_cast<std::byte>(1)}; - constexpr std::byte b8{static_cast<std::byte>(8)}; - constexpr std::byte b9{static_cast<std::byte>(9)}; + constexpr std::byte b1{static_cast<std::byte>(1)}; + constexpr std::byte b8{static_cast<std::byte>(8)}; + constexpr std::byte b9{static_cast<std::byte>(9)}; - static_assert(noexcept(b1 ^ b8), "" ); + static_assert(noexcept(b1 ^ b8), "" ); - static_assert(std::to_integer<int>(b1 ^ b8) == 9, ""); - static_assert(std::to_integer<int>(b1 ^ b9) == 8, ""); - static_assert(std::to_integer<int>(b8 ^ b9) == 1, ""); + static_assert(std::to_integer<int>(b1 ^ b8) == 9, ""); + static_assert(std::to_integer<int>(b1 ^ b9) == 8, ""); + static_assert(std::to_integer<int>(b8 ^ b9) == 1, ""); - static_assert(std::to_integer<int>(b8 ^ b1) == 9, ""); - static_assert(std::to_integer<int>(b9 ^ b1) == 8, ""); - static_assert(std::to_integer<int>(b9 ^ b8) == 1, ""); + static_assert(std::to_integer<int>(b8 ^ b1) == 9, ""); + static_assert(std::to_integer<int>(b9 ^ b1) == 8, ""); + static_assert(std::to_integer<int>(b9 ^ b8) == 1, ""); } diff --git a/test/std/language.support/support.types/nullptr_t.pass.cpp b/test/std/language.support/support.types/nullptr_t.pass.cpp index 2d0ed7410590..ffa0c90d4d86 100644 --- a/test/std/language.support/support.types/nullptr_t.pass.cpp +++ b/test/std/language.support/support.types/nullptr_t.pass.cpp @@ -91,7 +91,7 @@ int main() { #ifdef _LIBCPP_HAS_NO_NULLPTR static_assert(!has_less<std::nullptr_t>::value, ""); - // FIXME: our c++03 nullptr emulation still allows for comparisons + // FIXME: our C++03 nullptr emulation still allows for comparisons // with other pointer types by way of the conversion operator. //static_assert(!has_less<void*>::value, ""); #else |
