//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // Make sure that std::allocator is trivial. This was the case before C++20 // with the std::allocator explicit specialization, and this test makes sure // that we maintain that property across all standards. // // This is important since triviality has implications on how the type is passed // as a function argument in the ABI. #include #include typedef std::allocator A1; struct A2 : std::allocator { }; static_assert(std::is_trivially_default_constructible::value, ""); static_assert(std::is_trivially_copyable::value, ""); static_assert(std::is_trivially_default_constructible::value, ""); static_assert(std::is_trivially_copyable::value, "");