From eab1a1d4914a51de8383b818bf595125fb830c51 Mon Sep 17 00:00:00 2001 From: halbi2 Date: Thu, 12 Jun 2025 13:15:41 -0400 Subject: [PATCH] [libc++][test] Improve test coverage for flat_set (lack of) SCARY iterators (#139649) Missing from 5e94e26a7afb8db00cc123e5fc5471c1125596e3. --- .../flat.set/scary.compile.pass.cpp | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 libcxx/test/libcxx/containers/container.adaptors/flat.set/scary.compile.pass.cpp diff --git a/libcxx/test/libcxx/containers/container.adaptors/flat.set/scary.compile.pass.cpp b/libcxx/test/libcxx/containers/container.adaptors/flat.set/scary.compile.pass.cpp new file mode 100644 index 000000000000..99e93fc3b08b --- /dev/null +++ b/libcxx/test/libcxx/containers/container.adaptors/flat.set/scary.compile.pass.cpp @@ -0,0 +1,33 @@ +//===----------------------------------------------------------------------===// +// +// 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 +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 + +// + +// class flat_set +// class flat_multiset + +// Extension: SCARY/N2913 iterator compatibility between flat_set and flat_multiset +// Test for the absence of this feature + +#include +#include + +#include "test_macros.h" + +void test() { + typedef std::flat_set M1; + typedef std::flat_multiset M2; + + static_assert(!std::is_convertible_v); + static_assert(!std::is_convertible_v); + + static_assert(!std::is_convertible_v); + static_assert(!std::is_convertible_v); +}