Index: libcxx/include/CMakeLists.txt =================================================================== --- libcxx/include/CMakeLists.txt +++ libcxx/include/CMakeLists.txt @@ -350,6 +350,7 @@ __ranges/take_view.h __ranges/transform_view.h __ranges/view_interface.h + __ranges/views.h __split_buffer __std_stream __string Index: libcxx/include/__ranges/views.h =================================================================== --- /dev/null +++ libcxx/include/__ranges/views.h @@ -0,0 +1,31 @@ +// -*- 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 +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP___RANGES_VIEWS +#define _LIBCPP___RANGES_VIEWS + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_STD + +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) + +namespace ranges { + +namespace views { } + +} // namespace ranges + +namespace views = ranges::views; + +#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) + +#endif // _LIBCPP___RANGES_VIEWS Index: libcxx/include/module.modulemap =================================================================== --- libcxx/include/module.modulemap +++ libcxx/include/module.modulemap @@ -816,6 +816,7 @@ export functional.__functional.perfect_forward } module view_interface { private header "__ranges/view_interface.h" } + module views { private header "__ranges/views.h" } } } module ratio { Index: libcxx/include/ranges =================================================================== --- libcxx/include/ranges +++ libcxx/include/ranges @@ -228,6 +228,7 @@ #include <__ranges/take_view.h> #include <__ranges/transform_view.h> #include <__ranges/view_interface.h> +#include <__ranges/views.h> #include // Required by the standard. #include // Required by the standard. #include // Required by the standard. @@ -237,16 +238,6 @@ #pragma GCC system_header #endif -_LIBCPP_BEGIN_NAMESPACE_STD - -#if !defined(_LIBCPP_HAS_NO_CONCEPTS) - -namespace views = ranges::views; - -#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) - -_LIBCPP_END_NAMESPACE_STD - #endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) #endif // _LIBCPP_RANGES Index: libcxx/test/libcxx/diagnostics/detail.headers/ranges/views.module.verify.cpp =================================================================== --- /dev/null +++ libcxx/test/libcxx/diagnostics/detail.headers/ranges/views.module.verify.cpp @@ -0,0 +1,15 @@ +//===----------------------------------------------------------------------===// +// +// 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 +// +//===----------------------------------------------------------------------===// + +// REQUIRES: modules-build + +// WARNING: This test was generated by 'generate_private_header_tests.py' +// and should not be edited manually. + +// expected-error@*:* {{use of private header from outside its module: '__ranges/views.h'}} +#include <__ranges/views.h>