[libcxx-commits] [libcxx] [libc++] Avoid opening namespaces without putting something in them (PR #181136)
via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Feb 12 05:04:48 PST 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions hpp,,h,cpp -- libcxx/test/tools/clang_tidy_checks/empty_namespaces.cpp libcxx/test/tools/clang_tidy_checks/empty_namespaces.hpp libcxx/include/__algorithm/in_out_result.h libcxx/include/__algorithm/lexicographical_compare_three_way.h libcxx/include/__algorithm/out_value_result.h libcxx/include/__algorithm/radix_sort.h libcxx/include/__algorithm/ranges_copy_n.h libcxx/include/__algorithm/three_way_comp_ref_type.h libcxx/include/__atomic/atomic_sync.h libcxx/include/__atomic/atomic_sync_timed.h libcxx/include/__atomic/atomic_waitable_traits.h libcxx/include/__atomic/floating_point_helper.h libcxx/include/__bit/bit_cast.h libcxx/include/__bit/bit_ceil.h libcxx/include/__charconv/to_chars.h libcxx/include/__chrono/gps_clock.h libcxx/include/__chrono/tai_clock.h libcxx/include/__chrono/time_zone.h libcxx/include/__chrono/time_zone_link.h libcxx/include/__chrono/tzdb.h libcxx/include/__chrono/tzdb_list.h libcxx/include/__chrono/utc_clock.h libcxx/include/__chrono/zoned_time.h libcxx/include/__compare/common_comparison_category.h libcxx/include/__compare/compare_three_way.h libcxx/include/__compare/compare_three_way_result.h libcxx/include/__compare/ordering.h libcxx/include/__compare/synth_three_way.h libcxx/include/__compare/three_way_comparable.h libcxx/include/__concepts/arithmetic.h libcxx/include/__concepts/assignable.h libcxx/include/__concepts/boolean_testable.h libcxx/include/__concepts/class_or_enum.h libcxx/include/__concepts/common_reference_with.h libcxx/include/__concepts/comparison_common_type.h libcxx/include/__concepts/constructible.h libcxx/include/__concepts/convertible_to.h libcxx/include/__concepts/copyable.h libcxx/include/__concepts/derived_from.h libcxx/include/__concepts/destructible.h libcxx/include/__concepts/different_from.h libcxx/include/__concepts/equality_comparable.h libcxx/include/__concepts/invocable.h libcxx/include/__concepts/movable.h libcxx/include/__concepts/predicate.h libcxx/include/__concepts/regular.h libcxx/include/__concepts/relation.h libcxx/include/__concepts/same_as.h libcxx/include/__concepts/semiregular.h libcxx/include/__concepts/swappable.h libcxx/include/__concepts/totally_ordered.h libcxx/include/__cstddef/max_align_t.h libcxx/include/__format/container_adaptor.h libcxx/include/__format/enable_insertable.h libcxx/include/__format/escaped_output_table.h libcxx/include/__format/fmt_pair_like.h libcxx/include/__format/formatter_tuple.h libcxx/include/__format/range_default_formatter.h libcxx/include/__format/range_format.h libcxx/include/__format/range_formatter.h libcxx/include/__functional/binary_negate.h libcxx/include/__functional/binder1st.h libcxx/include/__functional/binder2nd.h libcxx/include/__functional/compose.h libcxx/include/__functional/invoke.h libcxx/include/__functional/mem_fun_ref.h libcxx/include/__functional/perfect_forward.h libcxx/include/__functional/pointer_to_binary_function.h libcxx/include/__functional/pointer_to_unary_function.h libcxx/include/__functional/ranges_operations.h libcxx/include/__functional/unary_negate.h libcxx/include/__fwd/span.h libcxx/include/__fwd/variant.h libcxx/include/__iterator/data.h libcxx/include/__iterator/default_sentinel.h libcxx/include/__iterator/empty.h libcxx/include/__iterator/incrementable_traits.h libcxx/include/__iterator/iter_move.h libcxx/include/__iterator/iter_swap.h libcxx/include/__iterator/move_sentinel.h libcxx/include/__iterator/ranges_iterator_traits.h libcxx/include/__iterator/readable_traits.h libcxx/include/__iterator/reverse_access.h libcxx/include/__iterator/size.h libcxx/include/__math/special_functions.h libcxx/include/__mdspan/aligned_accessor.h libcxx/include/__memory/inout_ptr.h libcxx/include/__memory/is_sufficiently_aligned.h libcxx/include/__memory/out_ptr.h libcxx/include/__memory/raw_storage_iterator.h libcxx/include/__memory/uses_allocator_construction.h libcxx/include/__node_handle libcxx/include/__numeric/ranges_iota.h libcxx/include/__random/uniform_random_bit_generator.h libcxx/include/__ranges/access.h libcxx/include/__ranges/all.h libcxx/include/__ranges/concepts.h libcxx/include/__ranges/container_compatible_range.h libcxx/include/__ranges/dangling.h libcxx/include/__ranges/data.h libcxx/include/__ranges/elements_of.h libcxx/include/__ranges/empty.h libcxx/include/__ranges/enable_borrowed_range.h libcxx/include/__ranges/enable_view.h libcxx/include/__ranges/from_range.h libcxx/include/__ranges/owning_view.h libcxx/include/__ranges/range_adaptor.h libcxx/include/__ranges/ref_view.h libcxx/include/__ranges/repeat_view.h libcxx/include/__ranges/size.h libcxx/include/__ranges/subrange.h libcxx/include/__ranges/view_interface.h libcxx/include/__ranges/views.h libcxx/include/__stop_token/atomic_unique_lock.h libcxx/include/__stop_token/intrusive_list_view.h libcxx/include/__stop_token/intrusive_shared_ptr.h libcxx/include/__stop_token/stop_callback.h libcxx/include/__stop_token/stop_state.h libcxx/include/__stop_token/stop_token.h libcxx/include/__tuple/sfinae_helpers.h libcxx/include/__tuple/tuple_like.h libcxx/include/__tuple/tuple_like_no_subrange.h libcxx/include/__type_traits/common_reference.h libcxx/include/__type_traits/has_unique_object_representation.h libcxx/include/__type_traits/is_implicitly_default_constructible.h libcxx/include/__type_traits/is_literal_type.h libcxx/include/__type_traits/result_of.h libcxx/include/__utility/exchange.h libcxx/include/__utility/forward_like.h libcxx/include/__utility/in_place.h libcxx/include/__variant/monostate.h libcxx/include/__verbose_trap libcxx/include/any libcxx/include/charconv libcxx/include/cuchar libcxx/include/experimental/memory libcxx/include/initializer_list libcxx/include/scoped_allocator libcxx/include/source_location libcxx/include/span libcxx/include/syncstream libcxx/include/tuple libcxx/include/variant libcxx/test/tools/clang_tidy_checks/libcpp_module.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libcxx/include/__ranges/views.h b/libcxx/include/__ranges/views.h
index 8a931d3ae..af6f150cb 100644
--- a/libcxx/include/__ranges/views.h
+++ b/libcxx/include/__ranges/views.h
@@ -22,7 +22,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
namespace ranges {
-namespace views {} // NOLINT(libcpp-avoid-empty-namespaces) // This is needed to declare the alias below.
+namespace views {} // namespace views
} // namespace ranges
diff --git a/libcxx/include/__type_traits/is_literal_type.h b/libcxx/include/__type_traits/is_literal_type.h
index 327150bc0..264d36f4f 100644
--- a/libcxx/include/__type_traits/is_literal_type.h
+++ b/libcxx/include/__type_traits/is_literal_type.h
@@ -31,6 +31,6 @@ _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
+#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
#endif // _LIBCPP___TYPE_TRAITS_IS_LITERAL_TYPE
diff --git a/libcxx/include/__type_traits/result_of.h b/libcxx/include/__type_traits/result_of.h
index 644e9bbdb..cdb7b1c8f 100644
--- a/libcxx/include/__type_traits/result_of.h
+++ b/libcxx/include/__type_traits/result_of.h
@@ -40,6 +40,6 @@ using result_of_t _LIBCPP_DEPRECATED_IN_CXX17 = typename result_of<_Tp>::type;
_LIBCPP_END_NAMESPACE_STD
-#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
+#endif // _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)
#endif // _LIBCPP___TYPE_TRAITS_RESULT_OF_H
``````````
</details>
https://github.com/llvm/llvm-project/pull/181136
More information about the libcxx-commits
mailing list