diff --git a/libcxx/include/__config b/libcxx/include/__config --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -1455,6 +1455,24 @@ #define _LIBCPP_FORMAT_PRINTF(a, b) #endif +#if !defined(__clang__) || !__building_module(std_config) +# define _LIBCPP_HAS_NO_MODULES +#endif + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) +# if defined(_LIBCPP_COMPILER_MSVC) +# define _LIBCPP_PUSH_DETAIL_HEADER_PASS \ + __pragma(push_macro("_LIBCPP_DETAIL_HEADERS_ALLOWED")) +# define _LIBCPP_POP_DETAIL_HEADER_PASS \ + __pragma(pop_macro("_LIBCPP_DETAIL_HEADERS_ALLOWED")) +# else +# define _LIBCPP_PUSH_DETAIL_HEADER_PASS \ + _Pragma("push_macro(\"_LIBCPP_DETAIL_HEADERS_ALLOWED\")") +# define _LIBCPP_POP_DETAIL_HEADER_PASS \ + _Pragma("pop_macro(\"_LIBCPP_DETAIL_HEADERS_ALLOWED\")") +# endif +#endif // defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) + #endif // __cplusplus #endif // _LIBCPP_CONFIG diff --git a/libcxx/include/__ranges/access.h b/libcxx/include/__ranges/access.h --- a/libcxx/include/__ranges/access.h +++ b/libcxx/include/__ranges/access.h @@ -10,6 +10,15 @@ #define _LIBCPP___RANGES_ACCESS_H #include <__config> +#if defined(_LIBCPP_HAS_NO_MODULES) && !defined(_LIBCPP_DETAIL_HEADERS_ALLOWED) +# error <__ranges/access.h> is a libc++ detail header and can't be directly included by users. Please '#include ' instead. +#endif + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) + _LIBCPP_PUSH_DETAIL_HEADER_PASS +# define _LIBCPP_DETAIL_HEADERS_ALLOWED +#endif + #include <__iterator/concepts.h> #include <__iterator/readable_traits.h> #include <__ranges/enable_borrowed_range.h> @@ -18,6 +27,11 @@ #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) +# undef _LIBCPP_DETAIL_HEADERS_ALLOWED + _LIBCPP_POP_DETAIL_HEADER_PASS +#endif + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif diff --git a/libcxx/include/__ranges/all.h b/libcxx/include/__ranges/all.h --- a/libcxx/include/__ranges/all.h +++ b/libcxx/include/__ranges/all.h @@ -10,6 +10,15 @@ #define _LIBCPP___RANGES_ALL_H #include <__config> +#if defined(_LIBCPP_HAS_NO_MODULES) && !defined(_LIBCPP_DETAIL_HEADERS_ALLOWED) +# error <__ranges/all.h> is a libc++ detail header and can't be directly included by users. Please '#include ' instead. +#endif + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) + _LIBCPP_PUSH_DETAIL_HEADER_PASS +# define _LIBCPP_DETAIL_HEADERS_ALLOWED +#endif + #include <__iterator/concepts.h> #include <__iterator/iterator_traits.h> #include <__ranges/access.h> @@ -21,6 +30,11 @@ #include <__utility/forward.h> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) +# undef _LIBCPP_DETAIL_HEADERS_ALLOWED + _LIBCPP_POP_DETAIL_HEADER_PASS +#endif + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif diff --git a/libcxx/include/__ranges/concepts.h b/libcxx/include/__ranges/concepts.h --- a/libcxx/include/__ranges/concepts.h +++ b/libcxx/include/__ranges/concepts.h @@ -10,6 +10,15 @@ #define _LIBCPP___RANGES_CONCEPTS_H #include <__config> +#if defined(_LIBCPP_HAS_NO_MODULES) && !defined(_LIBCPP_DETAIL_HEADERS_ALLOWED) +# error <__ranges/concepts.h> is a libc++ detail header and can't be directly included by users. Please '#include ' instead. +#endif + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) + _LIBCPP_PUSH_DETAIL_HEADER_PASS +# define _LIBCPP_DETAIL_HEADERS_ALLOWED +#endif + #include <__iterator/concepts.h> #include <__iterator/incrementable_traits.h> #include <__iterator/iter_move.h> @@ -23,6 +32,11 @@ #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) +# undef _LIBCPP_DETAIL_HEADERS_ALLOWED + _LIBCPP_POP_DETAIL_HEADER_PASS +#endif + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif diff --git a/libcxx/include/__ranges/copyable_box.h b/libcxx/include/__ranges/copyable_box.h --- a/libcxx/include/__ranges/copyable_box.h +++ b/libcxx/include/__ranges/copyable_box.h @@ -11,6 +11,15 @@ #define _LIBCPP___RANGES_COPYABLE_BOX_H #include <__config> +#if defined(_LIBCPP_HAS_NO_MODULES) && !defined(_LIBCPP_DETAIL_HEADERS_ALLOWED) +# error <__ranges/copyable_box.h> is a libc++ detail header and can't be directly included by users. +#endif + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) + _LIBCPP_PUSH_DETAIL_HEADER_PASS +# define _LIBCPP_DETAIL_HEADERS_ALLOWED +#endif + #include <__memory/addressof.h> #include <__memory/construct_at.h> #include <__utility/move.h> @@ -18,6 +27,11 @@ #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) + _LIBCPP_POP_DETAIL_HEADER_PASS +# undef _LIBCPP_DETAIL_HEADERS_ALLOWED +#endif + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif diff --git a/libcxx/include/__ranges/data.h b/libcxx/include/__ranges/data.h --- a/libcxx/include/__ranges/data.h +++ b/libcxx/include/__ranges/data.h @@ -10,6 +10,15 @@ #define _LIBCPP___RANGES_DATA_H #include <__config> +#if defined(_LIBCPP_HAS_NO_MODULES) && !defined(_LIBCPP_DETAIL_HEADERS_ALLOWED) +# error <__ranges/data.h> is a libc++ detail header and can't be directly included by users. Please '#include ' instead. +#endif + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) + _LIBCPP_PUSH_DETAIL_HEADER_PASS +# define _LIBCPP_DETAIL_HEADERS_ALLOWED +#endif + #include <__iterator/concepts.h> #include <__iterator/iterator_traits.h> #include <__memory/pointer_traits.h> @@ -18,6 +27,11 @@ #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) +# undef _LIBCPP_DETAIL_HEADERS_ALLOWED + _LIBCPP_POP_DETAIL_HEADER_PASS +#endif + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif diff --git a/libcxx/include/__ranges/drop_view.h b/libcxx/include/__ranges/drop_view.h --- a/libcxx/include/__ranges/drop_view.h +++ b/libcxx/include/__ranges/drop_view.h @@ -10,6 +10,15 @@ #define _LIBCPP___RANGES_DROP_VIEW_H #include <__config> +#if defined(_LIBCPP_HAS_NO_MODULES) && !defined(_LIBCPP_DETAIL_HEADERS_ALLOWED) +# error <__ranges/drop_view.h> is a libc++ detail header and can't be directly included by users. Please '#include ' instead. +#endif + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) + _LIBCPP_PUSH_DETAIL_HEADER_PASS +# define _LIBCPP_DETAIL_HEADERS_ALLOWED +#endif + #include <__iterator/concepts.h> #include <__iterator/iterator_traits.h> #include <__iterator/next.h> @@ -22,6 +31,11 @@ #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) +# undef _LIBCPP_DETAIL_HEADERS_ALLOWED + _LIBCPP_POP_DETAIL_HEADER_PASS +#endif + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif diff --git a/libcxx/include/__ranges/empty.h b/libcxx/include/__ranges/empty.h --- a/libcxx/include/__ranges/empty.h +++ b/libcxx/include/__ranges/empty.h @@ -10,12 +10,26 @@ #define _LIBCPP___RANGES_EMPTY_H #include <__config> +#if defined(_LIBCPP_HAS_NO_MODULES) && !defined(_LIBCPP_DETAIL_HEADERS_ALLOWED) +# error <__ranges/empty.h> is a libc++ detail header and can't be directly included by users. Please '#include ' instead. +#endif + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) + _LIBCPP_PUSH_DETAIL_HEADER_PASS +# define _LIBCPP_DETAIL_HEADERS_ALLOWED +#endif + #include <__iterator/concepts.h> #include <__ranges/access.h> #include <__ranges/size.h> #include <__utility/forward.h> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) +# undef _LIBCPP_DETAIL_HEADERS_ALLOWED + _LIBCPP_POP_DETAIL_HEADER_PASS +#endif + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif diff --git a/libcxx/include/__ranges/empty_view.h b/libcxx/include/__ranges/empty_view.h --- a/libcxx/include/__ranges/empty_view.h +++ b/libcxx/include/__ranges/empty_view.h @@ -10,9 +10,23 @@ #define _LIBCPP___RANGES_EMPTY_VIEW_H #include <__config> +#if defined(_LIBCPP_HAS_NO_MODULES) && !defined(_LIBCPP_DETAIL_HEADERS_ALLOWED) +# error <__ranges/empty_view.h> is a libc++ detail header and can't be directly included by users. Please '#include ' instead. +#endif + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) + _LIBCPP_PUSH_DETAIL_HEADER_PASS +# define _LIBCPP_DETAIL_HEADERS_ALLOWED +#endif + #include <__ranges/view_interface.h> #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) +# undef _LIBCPP_DETAIL_HEADERS_ALLOWED + _LIBCPP_POP_DETAIL_HEADER_PASS +#endif + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif diff --git a/libcxx/include/__ranges/enable_borrowed_range.h b/libcxx/include/__ranges/enable_borrowed_range.h --- a/libcxx/include/__ranges/enable_borrowed_range.h +++ b/libcxx/include/__ranges/enable_borrowed_range.h @@ -15,6 +15,9 @@ // and . #include <__config> +#if defined(_LIBCPP_HAS_NO_MODULES) && !defined(_LIBCPP_DETAIL_HEADERS_ALLOWED) +# error <__ranges/enable_borrowed_range.h> is a libc++ detail header and can't be directly included by users. Please '#include ' instead. +#endif #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__ranges/enable_view.h b/libcxx/include/__ranges/enable_view.h --- a/libcxx/include/__ranges/enable_view.h +++ b/libcxx/include/__ranges/enable_view.h @@ -11,6 +11,10 @@ #define _LIBCPP___RANGES_ENABLE_VIEW_H #include <__config> +#if defined(_LIBCPP_HAS_NO_MODULES) && !defined(_LIBCPP_DETAIL_HEADERS_ALLOWED) +# error <__ranges/enable_view.h> is a libc++ detail header and can't be directly included by users. Please '#include ' instead. +#endif + #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__ranges/ref_view.h b/libcxx/include/__ranges/ref_view.h --- a/libcxx/include/__ranges/ref_view.h +++ b/libcxx/include/__ranges/ref_view.h @@ -10,6 +10,15 @@ #define _LIBCPP___RANGES_REF_VIEW_H #include <__config> +#if defined(_LIBCPP_HAS_NO_MODULES) && !defined(_LIBCPP_DETAIL_HEADERS_ALLOWED) +# error <__ranges/ref_view.h> is a libc++ detail header and can't be directly included by users. Please '#include ' instead. +#endif + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) + _LIBCPP_PUSH_DETAIL_HEADER_PASS +# define _LIBCPP_DETAIL_HEADERS_ALLOWED +#endif + #include <__iterator/concepts.h> #include <__iterator/incrementable_traits.h> #include <__iterator/iterator_traits.h> @@ -23,6 +32,11 @@ #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) +# undef _LIBCPP_DETAIL_HEADERS_ALLOWED + _LIBCPP_POP_DETAIL_HEADER_PASS +#endif + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif diff --git a/libcxx/include/__ranges/size.h b/libcxx/include/__ranges/size.h --- a/libcxx/include/__ranges/size.h +++ b/libcxx/include/__ranges/size.h @@ -10,6 +10,15 @@ #define _LIBCPP___RANGES_SIZE_H #include <__config> +#if defined(_LIBCPP_HAS_NO_MODULES) && !defined(_LIBCPP_DETAIL_HEADERS_ALLOWED) +# error <__ranges/size.h> is a libc++ detail header and can't be directly included by users. Please '#include ' instead. +#endif + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) + _LIBCPP_PUSH_DETAIL_HEADER_PASS +# define _LIBCPP_DETAIL_HEADERS_ALLOWED +#endif + #include <__iterator/concepts.h> #include <__iterator/iterator_traits.h> #include <__ranges/access.h> @@ -18,6 +27,11 @@ #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) +# undef _LIBCPP_DETAIL_HEADERS_ALLOWED + _LIBCPP_POP_DETAIL_HEADER_PASS +#endif + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif diff --git a/libcxx/include/__ranges/subrange.h b/libcxx/include/__ranges/subrange.h --- a/libcxx/include/__ranges/subrange.h +++ b/libcxx/include/__ranges/subrange.h @@ -10,6 +10,15 @@ #define _LIBCPP___RANGES_SUBRANGE_H #include <__config> +#if defined(_LIBCPP_HAS_NO_MODULES) && !defined(_LIBCPP_DETAIL_HEADERS_ALLOWED) +# error <__ranges/subrange.h> is a libc++ detail header and can't be directly included by users. Please '#include ' instead. +#endif + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) + _LIBCPP_PUSH_DETAIL_HEADER_PASS +# define _LIBCPP_DETAIL_HEADERS_ALLOWED +#endif + #include <__iterator/concepts.h> #include <__iterator/incrementable_traits.h> #include <__iterator/iterator_traits.h> @@ -22,6 +31,11 @@ #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) +# undef _LIBCPP_DETAIL_HEADERS_ALLOWED + _LIBCPP_POP_DETAIL_HEADER_PASS +#endif + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif diff --git a/libcxx/include/__ranges/transform_view.h b/libcxx/include/__ranges/transform_view.h --- a/libcxx/include/__ranges/transform_view.h +++ b/libcxx/include/__ranges/transform_view.h @@ -10,6 +10,16 @@ #define _LIBCPP___RANGES_TRANSFORM_VIEW_H #include <__config> +#if defined(_LIBCPP_HAS_NO_MODULES) && !defined(_LIBCPP_DETAIL_HEADERS_ALLOWED) +# error <__ranges/transform_view.h> is a libc++ detail header and can't be directly included by users. Please '#include ' instead. +#endif + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) + _LIBCPP_PUSH_DETAIL_HEADER_PASS +# define _LIBCPP_DETAIL_HEADERS_ALLOWED +#endif + +#include <__iterator/iterator_traits.h> #include <__iterator/concepts.h> #include <__iterator/iter_swap.h> #include <__iterator/iterator_traits.h> @@ -23,6 +33,11 @@ #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) +# undef _LIBCPP_DETAIL_HEADERS_ALLOWED + _LIBCPP_POP_DETAIL_HEADER_PASS +#endif + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif diff --git a/libcxx/include/__ranges/view_interface.h b/libcxx/include/__ranges/view_interface.h --- a/libcxx/include/__ranges/view_interface.h +++ b/libcxx/include/__ranges/view_interface.h @@ -10,6 +10,15 @@ #define _LIBCPP___RANGES_VIEW_INTERFACE_H #include <__config> +#if defined(_LIBCPP_HAS_NO_MODULES) && !defined(_LIBCPP_DETAIL_HEADERS_ALLOWED) +# error <__ranges/view_interface.h> is a libc++ detail header and can't be directly included by users. Please '#include ' instead. +#endif + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) + _LIBCPP_PUSH_DETAIL_HEADER_PASS +# define _LIBCPP_DETAIL_HEADERS_ALLOWED +#endif + #include <__iterator/concepts.h> #include <__iterator/iterator_traits.h> #include <__iterator/prev.h> @@ -21,6 +30,11 @@ #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) +# undef _LIBCPP_DETAIL_HEADERS_ALLOWED + _LIBCPP_POP_DETAIL_HEADER_PASS +#endif + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif diff --git a/libcxx/include/iterator b/libcxx/include/iterator --- a/libcxx/include/iterator +++ b/libcxx/include/iterator @@ -559,7 +559,11 @@ */ #include <__config> -#include <__debug> +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) + _LIBCPP_PUSH_DETAIL_HEADER_PASS +# define _LIBCPP_DETAIL_HEADERS_ALLOWED +#endif + #include <__functional_base> #include <__iterator/access.h> #include <__iterator/advance.h> @@ -600,6 +604,11 @@ #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) +# undef _LIBCPP_DETAIL_HEADERS_ALLOWED + _LIBCPP_POP_DETAIL_HEADER_PASS +#endif + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif diff --git a/libcxx/include/ranges b/libcxx/include/ranges --- a/libcxx/include/ranges +++ b/libcxx/include/ranges @@ -132,6 +132,11 @@ */ #include <__config> +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) + _LIBCPP_PUSH_DETAIL_HEADER_PASS +# define _LIBCPP_DETAIL_HEADERS_ALLOWED +#endif + #include <__ranges/access.h> #include <__ranges/all.h> #include <__ranges/concepts.h> @@ -152,6 +157,11 @@ #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) +# undef _LIBCPP_DETAIL_HEADERS_ALLOWED + _LIBCPP_POP_DETAIL_HEADER_PASS +#endif + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif diff --git a/libcxx/include/span b/libcxx/include/span --- a/libcxx/include/span +++ b/libcxx/include/span @@ -128,6 +128,11 @@ */ #include <__config> +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) + _LIBCPP_PUSH_DETAIL_HEADER_PASS +# define _LIBCPP_DETAIL_HEADERS_ALLOWED +#endif + #include <__debug> #include <__iterator/wrap_iter.h> #include <__ranges/enable_borrowed_range.h> @@ -139,6 +144,11 @@ #include // for remove_cv, etc #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) +#undef _LIBCPP_DETAIL_HEADERS_ALLOWED +_LIBCPP_POP_DETAIL_HEADER_PASS +#endif + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif diff --git a/libcxx/include/string_view b/libcxx/include/string_view --- a/libcxx/include/string_view +++ b/libcxx/include/string_view @@ -185,6 +185,11 @@ */ #include <__config> +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) + _LIBCPP_PUSH_DETAIL_HEADER_PASS +# define _LIBCPP_DETAIL_HEADERS_ALLOWED +#endif + #include <__debug> #include <__ranges/enable_borrowed_range.h> #include <__ranges/enable_view.h> @@ -197,6 +202,11 @@ #include #include +#if !defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) +#undef _LIBCPP_DETAIL_HEADERS_ALLOWED +_LIBCPP_POP_DETAIL_HEADER_PASS +#endif + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif diff --git a/libcxx/test/libcxx/diagnostics/detail.headers/ranges/access.header.verify.cpp b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/access.header.verify.cpp new file mode 100644 --- /dev/null +++ b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/access.header.verify.cpp @@ -0,0 +1,13 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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: modules-build + +// expected-error@*:* {{<__ranges/access.h> is a libc++ detail header and can't be directly included by users. Please '#include ' instead.}} +#include <__ranges/access.h> diff --git a/libcxx/test/libcxx/diagnostics/detail.headers/ranges/all.header.verify.cpp b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/all.header.verify.cpp new file mode 100644 --- /dev/null +++ b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/all.header.verify.cpp @@ -0,0 +1,13 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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: modules-build + +// expected-error@*:* {{<__ranges/all.h> is a libc++ detail header and can't be directly included by users. Please '#include ' instead.}} +#include <__ranges/all.h> diff --git a/libcxx/test/libcxx/diagnostics/detail.headers/ranges/concepts.header.verify.cpp b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/concepts.header.verify.cpp new file mode 100644 --- /dev/null +++ b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/concepts.header.verify.cpp @@ -0,0 +1,13 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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: modules-build + +// expected-error@*:* {{<__ranges/concepts.h> is a libc++ detail header and can't be directly included by users. Please '#include ' instead.}} +#include <__ranges/concepts.h> diff --git a/libcxx/test/libcxx/diagnostics/detail.headers/ranges/copyable_box.header.verify.cpp b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/copyable_box.header.verify.cpp new file mode 100644 --- /dev/null +++ b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/copyable_box.header.verify.cpp @@ -0,0 +1,13 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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: modules-build + +// expected-error@*:* {{<__ranges/copyable_box.h> is a libc++ detail header and can't be directly included by users.}} +#include <__ranges/copyable_box.h> diff --git a/libcxx/test/libcxx/diagnostics/detail.headers/ranges/data.header.verify.cpp b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/data.header.verify.cpp new file mode 100644 --- /dev/null +++ b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/data.header.verify.cpp @@ -0,0 +1,13 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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: modules-build + +// expected-error@*:* {{<__ranges/data.h> is a libc++ detail header and can't be directly included by users.}} +#include <__ranges/data.h> diff --git a/libcxx/test/libcxx/diagnostics/detail.headers/ranges/drop_view.header.verify.cpp b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/drop_view.header.verify.cpp new file mode 100644 --- /dev/null +++ b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/drop_view.header.verify.cpp @@ -0,0 +1,13 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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: modules-build + +// expected-error@*:* {{<__ranges/drop_view.h> is a libc++ detail header and can't be directly included by users. Please '#include ' instead.}} +#include <__ranges/drop_view.h> diff --git a/libcxx/test/libcxx/diagnostics/detail.headers/ranges/empty.header.verify.cpp b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/empty.header.verify.cpp new file mode 100644 --- /dev/null +++ b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/empty.header.verify.cpp @@ -0,0 +1,13 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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: modules-build + +// expected-error@*:* {{<__ranges/empty.h> is a libc++ detail header and can't be directly included by users. Please '#include ' instead.}} +#include <__ranges/empty.h> diff --git a/libcxx/test/libcxx/diagnostics/detail.headers/ranges/empty_view.header.verify.cpp b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/empty_view.header.verify.cpp new file mode 100644 --- /dev/null +++ b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/empty_view.header.verify.cpp @@ -0,0 +1,13 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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: modules-build + +// expected-error@*:* {{<__ranges/empty_view.h> is a libc++ detail header and can't be directly included by users. Please '#include ' instead.}} +#include <__ranges/empty_view.h> diff --git a/libcxx/test/libcxx/diagnostics/detail.headers/ranges/enable_borrowed_range.header.verify.cpp b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/enable_borrowed_range.header.verify.cpp new file mode 100644 --- /dev/null +++ b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/enable_borrowed_range.header.verify.cpp @@ -0,0 +1,13 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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: modules-build + +// expected-error@*:* {{<__ranges/enable_borrowed_range.h> is a libc++ detail header and can't be directly included by users. Please '#include ' instead.}} +#include <__ranges/enable_borrowed_range.h> diff --git a/libcxx/test/libcxx/diagnostics/detail.headers/ranges/enable_view.header.verify.cpp b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/enable_view.header.verify.cpp new file mode 100644 --- /dev/null +++ b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/enable_view.header.verify.cpp @@ -0,0 +1,13 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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: modules-build + +// expected-error@*:* {{<__ranges/enable_view.h> is a libc++ detail header and can't be directly included by users. Please '#include ' instead.}} +#include <__ranges/enable_view.h> diff --git a/libcxx/test/libcxx/diagnostics/detail.headers/ranges/ref_view.header.verify.cpp b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/ref_view.header.verify.cpp new file mode 100644 --- /dev/null +++ b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/ref_view.header.verify.cpp @@ -0,0 +1,13 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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: modules-build + +// expected-error@*:* {{<__ranges/ref_view.h> is a libc++ detail header and can't be directly included by users. Please '#include ' instead.}} +#include <__ranges/ref_view.h> diff --git a/libcxx/test/libcxx/diagnostics/detail.headers/ranges/size.header.verify.cpp b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/size.header.verify.cpp new file mode 100644 --- /dev/null +++ b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/size.header.verify.cpp @@ -0,0 +1,13 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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: modules-build + +// expected-error@*:* {{<__ranges/size.h> is a libc++ detail header and can't be directly included by users. Please '#include ' instead.}} +#include <__ranges/size.h> diff --git a/libcxx/test/libcxx/diagnostics/detail.headers/ranges/subrange.header.verify.cpp b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/subrange.header.verify.cpp new file mode 100644 --- /dev/null +++ b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/subrange.header.verify.cpp @@ -0,0 +1,13 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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: modules-build + +// expected-error@*:* {{<__ranges/subrange.h> is a libc++ detail header and can't be directly included by users. Please '#include ' instead.}} +#include <__ranges/subrange.h> diff --git a/libcxx/test/libcxx/diagnostics/detail.headers/ranges/transform_view.header.verify.cpp b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/transform_view.header.verify.cpp new file mode 100644 --- /dev/null +++ b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/transform_view.header.verify.cpp @@ -0,0 +1,13 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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: modules-build + +// expected-error@*:* {{<__ranges/transform_view.h> is a libc++ detail header and can't be directly included by users. Please '#include ' instead.}} +#include <__ranges/transform_view.h> diff --git a/libcxx/test/libcxx/diagnostics/detail.headers/ranges/view_interface.header.verify.cpp b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/view_interface.header.verify.cpp new file mode 100644 --- /dev/null +++ b/libcxx/test/libcxx/diagnostics/detail.headers/ranges/view_interface.header.verify.cpp @@ -0,0 +1,13 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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: modules-build + +// expected-error@*:* {{<__ranges/view_interface.h> is a libc++ detail header and can't be directly included by users. Please '#include ' instead.}} +#include <__ranges/view_interface.h>