diff --git a/libcxx/include/__algorithm/adjacent_find.h b/libcxx/include/__algorithm/adjacent_find.h --- a/libcxx/include/__algorithm/adjacent_find.h +++ b/libcxx/include/__algorithm/adjacent_find.h @@ -10,8 +10,8 @@ #ifndef _LIBCPP___ALGORITHM_ADJACENT_FIND_H #define _LIBCPP___ALGORITHM_ADJACENT_FIND_H -#include <__config> #include <__algorithm/comp.h> +#include <__config> #include <__iterator/iterator_traits.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/binary_search.h b/libcxx/include/__algorithm/binary_search.h --- a/libcxx/include/__algorithm/binary_search.h +++ b/libcxx/include/__algorithm/binary_search.h @@ -9,10 +9,10 @@ #ifndef _LIBCPP___ALGORITHM_BINARY_SEARCH_H #define _LIBCPP___ALGORITHM_BINARY_SEARCH_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/comp_ref_type.h> #include <__algorithm/lower_bound.h> +#include <__config> #include <__iterator/iterator_traits.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/clamp.h b/libcxx/include/__algorithm/clamp.h --- a/libcxx/include/__algorithm/clamp.h +++ b/libcxx/include/__algorithm/clamp.h @@ -9,9 +9,9 @@ #ifndef _LIBCPP___ALGORITHM_CLAMP_H #define _LIBCPP___ALGORITHM_CLAMP_H +#include <__algorithm/comp.h> #include <__config> #include <__debug> -#include <__algorithm/comp.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__algorithm/copy.h b/libcxx/include/__algorithm/copy.h --- a/libcxx/include/__algorithm/copy.h +++ b/libcxx/include/__algorithm/copy.h @@ -9,8 +9,8 @@ #ifndef _LIBCPP___ALGORITHM_COPY_H #define _LIBCPP___ALGORITHM_COPY_H -#include <__config> #include <__algorithm/unwrap_iter.h> +#include <__config> #include <__iterator/iterator_traits.h> #include #include diff --git a/libcxx/include/__algorithm/copy_backward.h b/libcxx/include/__algorithm/copy_backward.h --- a/libcxx/include/__algorithm/copy_backward.h +++ b/libcxx/include/__algorithm/copy_backward.h @@ -9,8 +9,8 @@ #ifndef _LIBCPP___ALGORITHM_COPY_BACKWARD_H #define _LIBCPP___ALGORITHM_COPY_BACKWARD_H -#include <__config> #include <__algorithm/unwrap_iter.h> +#include <__config> #include <__iterator/iterator_traits.h> #include #include diff --git a/libcxx/include/__algorithm/copy_if.h b/libcxx/include/__algorithm/copy_if.h --- a/libcxx/include/__algorithm/copy_if.h +++ b/libcxx/include/__algorithm/copy_if.h @@ -10,10 +10,6 @@ #define _LIBCPP___ALGORITHM_COPY_IF_H #include <__config> -#include <__algorithm/unwrap_iter.h> -#include <__iterator/iterator_traits.h> -#include -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__algorithm/copy_n.h b/libcxx/include/__algorithm/copy_n.h --- a/libcxx/include/__algorithm/copy_n.h +++ b/libcxx/include/__algorithm/copy_n.h @@ -9,11 +9,9 @@ #ifndef _LIBCPP___ALGORITHM_COPY_N_H #define _LIBCPP___ALGORITHM_COPY_N_H -#include <__config> #include <__algorithm/copy.h> -#include <__algorithm/unwrap_iter.h> +#include <__config> #include <__iterator/iterator_traits.h> -#include #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/equal.h b/libcxx/include/__algorithm/equal.h --- a/libcxx/include/__algorithm/equal.h +++ b/libcxx/include/__algorithm/equal.h @@ -10,8 +10,8 @@ #ifndef _LIBCPP___ALGORITHM_EQUAL_H #define _LIBCPP___ALGORITHM_EQUAL_H -#include <__config> #include <__algorithm/comp.h> +#include <__config> #include <__iterator/distance.h> #include <__iterator/iterator_traits.h> diff --git a/libcxx/include/__algorithm/equal_range.h b/libcxx/include/__algorithm/equal_range.h --- a/libcxx/include/__algorithm/equal_range.h +++ b/libcxx/include/__algorithm/equal_range.h @@ -9,12 +9,12 @@ #ifndef _LIBCPP___ALGORITHM_EQUAL_RANGE_H #define _LIBCPP___ALGORITHM_EQUAL_RANGE_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/comp_ref_type.h> #include <__algorithm/half_positive.h> #include <__algorithm/lower_bound.h> #include <__algorithm/upper_bound.h> +#include <__config> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/fill.h b/libcxx/include/__algorithm/fill.h --- a/libcxx/include/__algorithm/fill.h +++ b/libcxx/include/__algorithm/fill.h @@ -9,8 +9,8 @@ #ifndef _LIBCPP___ALGORITHM_FILL_H #define _LIBCPP___ALGORITHM_FILL_H -#include <__config> #include <__algorithm/fill_n.h> +#include <__config> #include <__iterator/iterator_traits.h> #include diff --git a/libcxx/include/__algorithm/find_end.h b/libcxx/include/__algorithm/find_end.h --- a/libcxx/include/__algorithm/find_end.h +++ b/libcxx/include/__algorithm/find_end.h @@ -10,8 +10,8 @@ #ifndef _LIBCPP___ALGORITHM_FIND_END_OF_H #define _LIBCPP___ALGORITHM_FIND_END_OF_H -#include <__config> #include <__algorithm/comp.h> +#include <__config> #include <__iterator/iterator_traits.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/find_first_of.h b/libcxx/include/__algorithm/find_first_of.h --- a/libcxx/include/__algorithm/find_first_of.h +++ b/libcxx/include/__algorithm/find_first_of.h @@ -10,8 +10,8 @@ #ifndef _LIBCPP___ALGORITHM_FIND_FIRST_OF_H #define _LIBCPP___ALGORITHM_FIND_FIRST_OF_H -#include <__config> #include <__algorithm/comp.h> +#include <__config> #include <__iterator/iterator_traits.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/includes.h b/libcxx/include/__algorithm/includes.h --- a/libcxx/include/__algorithm/includes.h +++ b/libcxx/include/__algorithm/includes.h @@ -9,9 +9,9 @@ #ifndef _LIBCPP___ALGORITHM_INCLUDES_H #define _LIBCPP___ALGORITHM_INCLUDES_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/comp_ref_type.h> +#include <__config> #include <__iterator/iterator_traits.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/inplace_merge.h b/libcxx/include/__algorithm/inplace_merge.h --- a/libcxx/include/__algorithm/inplace_merge.h +++ b/libcxx/include/__algorithm/inplace_merge.h @@ -9,14 +9,14 @@ #ifndef _LIBCPP___ALGORITHM_INPLACE_MERGE_H #define _LIBCPP___ALGORITHM_INPLACE_MERGE_H -#include <__config> -#include <__algorithm/comp_ref_type.h> #include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> #include <__algorithm/lower_bound.h> #include <__algorithm/min.h> #include <__algorithm/move.h> #include <__algorithm/rotate.h> #include <__algorithm/upper_bound.h> +#include <__config> #include <__iterator/iterator_traits.h> #include <__utility/swap.h> #include diff --git a/libcxx/include/__algorithm/is_heap.h b/libcxx/include/__algorithm/is_heap.h --- a/libcxx/include/__algorithm/is_heap.h +++ b/libcxx/include/__algorithm/is_heap.h @@ -9,10 +9,10 @@ #ifndef _LIBCPP___ALGORITHM_IS_HEAP_H #define _LIBCPP___ALGORITHM_IS_HEAP_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/comp_ref_type.h> #include <__algorithm/is_heap_until.h> +#include <__config> #include <__iterator/iterator_traits.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/is_heap_until.h b/libcxx/include/__algorithm/is_heap_until.h --- a/libcxx/include/__algorithm/is_heap_until.h +++ b/libcxx/include/__algorithm/is_heap_until.h @@ -9,9 +9,9 @@ #ifndef _LIBCPP___ALGORITHM_IS_HEAP_UNTIL_H #define _LIBCPP___ALGORITHM_IS_HEAP_UNTIL_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/comp_ref_type.h> +#include <__config> #include <__iterator/iterator_traits.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/is_sorted_until.h b/libcxx/include/__algorithm/is_sorted_until.h --- a/libcxx/include/__algorithm/is_sorted_until.h +++ b/libcxx/include/__algorithm/is_sorted_until.h @@ -9,9 +9,9 @@ #ifndef _LIBCPP___ALGORITHM_IS_SORTED_UNTIL_H #define _LIBCPP___ALGORITHM_IS_SORTED_UNTIL_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/comp_ref_type.h> +#include <__config> #include <__iterator/iterator_traits.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/lexicographical_compare.h b/libcxx/include/__algorithm/lexicographical_compare.h --- a/libcxx/include/__algorithm/lexicographical_compare.h +++ b/libcxx/include/__algorithm/lexicographical_compare.h @@ -9,9 +9,9 @@ #ifndef _LIBCPP___ALGORITHM_LEXICOGRAPHICAL_COMPARE_H #define _LIBCPP___ALGORITHM_LEXICOGRAPHICAL_COMPARE_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/comp_ref_type.h> +#include <__config> #include <__iterator/iterator_traits.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/lower_bound.h b/libcxx/include/__algorithm/lower_bound.h --- a/libcxx/include/__algorithm/lower_bound.h +++ b/libcxx/include/__algorithm/lower_bound.h @@ -9,9 +9,9 @@ #ifndef _LIBCPP___ALGORITHM_LOWER_BOUND_H #define _LIBCPP___ALGORITHM_LOWER_BOUND_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/half_positive.h> +#include <__config> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/make_heap.h b/libcxx/include/__algorithm/make_heap.h --- a/libcxx/include/__algorithm/make_heap.h +++ b/libcxx/include/__algorithm/make_heap.h @@ -9,10 +9,10 @@ #ifndef _LIBCPP___ALGORITHM_MAKE_HEAP_H #define _LIBCPP___ALGORITHM_MAKE_HEAP_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/comp_ref_type.h> #include <__algorithm/sift_down.h> +#include <__config> #include <__iterator/iterator_traits.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/max.h b/libcxx/include/__algorithm/max.h --- a/libcxx/include/__algorithm/max.h +++ b/libcxx/include/__algorithm/max.h @@ -9,10 +9,10 @@ #ifndef _LIBCPP___ALGORITHM_MAX_H #define _LIBCPP___ALGORITHM_MAX_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/comp_ref_type.h> #include <__algorithm/max_element.h> +#include <__config> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/max_element.h b/libcxx/include/__algorithm/max_element.h --- a/libcxx/include/__algorithm/max_element.h +++ b/libcxx/include/__algorithm/max_element.h @@ -9,9 +9,9 @@ #ifndef _LIBCPP___ALGORITHM_MAX_ELEMENT_H #define _LIBCPP___ALGORITHM_MAX_ELEMENT_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/comp_ref_type.h> +#include <__config> #include <__iterator/iterator_traits.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/merge.h b/libcxx/include/__algorithm/merge.h --- a/libcxx/include/__algorithm/merge.h +++ b/libcxx/include/__algorithm/merge.h @@ -9,10 +9,10 @@ #ifndef _LIBCPP___ALGORITHM_MERGE_H #define _LIBCPP___ALGORITHM_MERGE_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/comp_ref_type.h> #include <__algorithm/copy.h> +#include <__config> #include <__iterator/iterator_traits.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/min.h b/libcxx/include/__algorithm/min.h --- a/libcxx/include/__algorithm/min.h +++ b/libcxx/include/__algorithm/min.h @@ -9,10 +9,10 @@ #ifndef _LIBCPP___ALGORITHM_MIN_H #define _LIBCPP___ALGORITHM_MIN_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/comp_ref_type.h> #include <__algorithm/min_element.h> +#include <__config> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/min_element.h b/libcxx/include/__algorithm/min_element.h --- a/libcxx/include/__algorithm/min_element.h +++ b/libcxx/include/__algorithm/min_element.h @@ -9,9 +9,9 @@ #ifndef _LIBCPP___ALGORITHM_MIN_ELEMENT_H #define _LIBCPP___ALGORITHM_MIN_ELEMENT_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/comp_ref_type.h> +#include <__config> #include <__iterator/iterator_traits.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/minmax.h b/libcxx/include/__algorithm/minmax.h --- a/libcxx/include/__algorithm/minmax.h +++ b/libcxx/include/__algorithm/minmax.h @@ -9,12 +9,11 @@ #ifndef _LIBCPP___ALGORITHM_MINMAX_H #define _LIBCPP___ALGORITHM_MINMAX_H -#include <__config> #include <__algorithm/comp.h> +#include <__config> #include #include - #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif diff --git a/libcxx/include/__algorithm/minmax_element.h b/libcxx/include/__algorithm/minmax_element.h --- a/libcxx/include/__algorithm/minmax_element.h +++ b/libcxx/include/__algorithm/minmax_element.h @@ -9,8 +9,8 @@ #ifndef _LIBCPP___ALGORITHM_MINMAX_ELEMENT_H #define _LIBCPP___ALGORITHM_MINMAX_ELEMENT_H -#include <__config> #include <__algorithm/comp.h> +#include <__config> #include <__iterator/iterator_traits.h> #include diff --git a/libcxx/include/__algorithm/mismatch.h b/libcxx/include/__algorithm/mismatch.h --- a/libcxx/include/__algorithm/mismatch.h +++ b/libcxx/include/__algorithm/mismatch.h @@ -10,8 +10,8 @@ #ifndef _LIBCPP___ALGORITHM_MISMATCH_H #define _LIBCPP___ALGORITHM_MISMATCH_H -#include <__config> #include <__algorithm/comp.h> +#include <__config> #include <__iterator/iterator_traits.h> #include diff --git a/libcxx/include/__algorithm/move.h b/libcxx/include/__algorithm/move.h --- a/libcxx/include/__algorithm/move.h +++ b/libcxx/include/__algorithm/move.h @@ -9,12 +9,12 @@ #ifndef _LIBCPP___ALGORITHM_MOVE_H #define _LIBCPP___ALGORITHM_MOVE_H -#include <__config> #include <__algorithm/unwrap_iter.h> +#include <__config> #include <__utility/move.h> #include -#include #include +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__algorithm/move_backward.h b/libcxx/include/__algorithm/move_backward.h --- a/libcxx/include/__algorithm/move_backward.h +++ b/libcxx/include/__algorithm/move_backward.h @@ -9,11 +9,11 @@ #ifndef _LIBCPP___ALGORITHM_MOVE_BACKWARD_H #define _LIBCPP___ALGORITHM_MOVE_BACKWARD_H -#include <__config> #include <__algorithm/unwrap_iter.h> +#include <__config> #include -#include #include +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__algorithm/next_permutation.h b/libcxx/include/__algorithm/next_permutation.h --- a/libcxx/include/__algorithm/next_permutation.h +++ b/libcxx/include/__algorithm/next_permutation.h @@ -9,10 +9,10 @@ #ifndef _LIBCPP___ALGORITHM_NEXT_PERMUTATION_H #define _LIBCPP___ALGORITHM_NEXT_PERMUTATION_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/comp_ref_type.h> #include <__algorithm/reverse.h> +#include <__config> #include <__iterator/iterator_traits.h> #include <__utility/swap.h> diff --git a/libcxx/include/__algorithm/nth_element.h b/libcxx/include/__algorithm/nth_element.h --- a/libcxx/include/__algorithm/nth_element.h +++ b/libcxx/include/__algorithm/nth_element.h @@ -9,10 +9,10 @@ #ifndef _LIBCPP___ALGORITHM_NTH_ELEMENT_H #define _LIBCPP___ALGORITHM_NTH_ELEMENT_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/comp_ref_type.h> #include <__algorithm/sort.h> +#include <__config> #include <__iterator/iterator_traits.h> #include <__utility/swap.h> diff --git a/libcxx/include/__algorithm/partial_sort.h b/libcxx/include/__algorithm/partial_sort.h --- a/libcxx/include/__algorithm/partial_sort.h +++ b/libcxx/include/__algorithm/partial_sort.h @@ -9,12 +9,12 @@ #ifndef _LIBCPP___ALGORITHM_PARTIAL_SORT_H #define _LIBCPP___ALGORITHM_PARTIAL_SORT_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/comp_ref_type.h> #include <__algorithm/make_heap.h> #include <__algorithm/sift_down.h> #include <__algorithm/sort_heap.h> +#include <__config> #include <__iterator/iterator_traits.h> #include <__utility/swap.h> diff --git a/libcxx/include/__algorithm/partial_sort_copy.h b/libcxx/include/__algorithm/partial_sort_copy.h --- a/libcxx/include/__algorithm/partial_sort_copy.h +++ b/libcxx/include/__algorithm/partial_sort_copy.h @@ -9,14 +9,13 @@ #ifndef _LIBCPP___ALGORITHM_PARTIAL_SORT_COPY_H #define _LIBCPP___ALGORITHM_PARTIAL_SORT_COPY_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/comp_ref_type.h> #include <__algorithm/make_heap.h> #include <__algorithm/sift_down.h> #include <__algorithm/sort_heap.h> +#include <__config> #include <__iterator/iterator_traits.h> -#include // swap #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__algorithm/partition.h b/libcxx/include/__algorithm/partition.h --- a/libcxx/include/__algorithm/partition.h +++ b/libcxx/include/__algorithm/partition.h @@ -12,7 +12,6 @@ #include <__config> #include <__iterator/iterator_traits.h> #include <__utility/swap.h> -#include // pair #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__algorithm/partition_point.h b/libcxx/include/__algorithm/partition_point.h --- a/libcxx/include/__algorithm/partition_point.h +++ b/libcxx/include/__algorithm/partition_point.h @@ -9,8 +9,8 @@ #ifndef _LIBCPP___ALGORITHM_PARTITION_POINT_H #define _LIBCPP___ALGORITHM_PARTITION_POINT_H -#include <__config> #include <__algorithm/half_positive.h> +#include <__config> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/pop_heap.h b/libcxx/include/__algorithm/pop_heap.h --- a/libcxx/include/__algorithm/pop_heap.h +++ b/libcxx/include/__algorithm/pop_heap.h @@ -9,10 +9,10 @@ #ifndef _LIBCPP___ALGORITHM_POP_HEAP_H #define _LIBCPP___ALGORITHM_POP_HEAP_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/comp_ref_type.h> #include <__algorithm/sift_down.h> +#include <__config> #include <__iterator/iterator_traits.h> #include <__utility/swap.h> diff --git a/libcxx/include/__algorithm/prev_permutation.h b/libcxx/include/__algorithm/prev_permutation.h --- a/libcxx/include/__algorithm/prev_permutation.h +++ b/libcxx/include/__algorithm/prev_permutation.h @@ -9,10 +9,10 @@ #ifndef _LIBCPP___ALGORITHM_PREV_PERMUTATION_H #define _LIBCPP___ALGORITHM_PREV_PERMUTATION_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/comp_ref_type.h> #include <__algorithm/reverse.h> +#include <__config> #include <__iterator/iterator_traits.h> #include <__utility/swap.h> diff --git a/libcxx/include/__algorithm/push_heap.h b/libcxx/include/__algorithm/push_heap.h --- a/libcxx/include/__algorithm/push_heap.h +++ b/libcxx/include/__algorithm/push_heap.h @@ -9,9 +9,9 @@ #ifndef _LIBCPP___ALGORITHM_PUSH_HEAP_H #define _LIBCPP___ALGORITHM_PUSH_HEAP_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/comp_ref_type.h> +#include <__config> #include <__iterator/iterator_traits.h> #include <__utility/move.h> diff --git a/libcxx/include/__algorithm/remove.h b/libcxx/include/__algorithm/remove.h --- a/libcxx/include/__algorithm/remove.h +++ b/libcxx/include/__algorithm/remove.h @@ -9,9 +9,9 @@ #ifndef _LIBCPP___ALGORITHM_REMOVE_H #define _LIBCPP___ALGORITHM_REMOVE_H -#include <__config> #include <__algorithm/find.h> #include <__algorithm/find_if.h> +#include <__config> #include <__utility/move.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/remove_if.h b/libcxx/include/__algorithm/remove_if.h --- a/libcxx/include/__algorithm/remove_if.h +++ b/libcxx/include/__algorithm/remove_if.h @@ -9,8 +9,8 @@ #ifndef _LIBCPP___ALGORITHM_REMOVE_IF_H #define _LIBCPP___ALGORITHM_REMOVE_IF_H -#include <__config> #include <__algorithm/find_if.h> +#include <__config> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/reverse.h b/libcxx/include/__algorithm/reverse.h --- a/libcxx/include/__algorithm/reverse.h +++ b/libcxx/include/__algorithm/reverse.h @@ -9,8 +9,8 @@ #ifndef _LIBCPP___ALGORITHM_REVERSE_H #define _LIBCPP___ALGORITHM_REVERSE_H -#include <__config> #include <__algorithm/iter_swap.h> +#include <__config> #include <__iterator/iterator_traits.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/rotate_copy.h b/libcxx/include/__algorithm/rotate_copy.h --- a/libcxx/include/__algorithm/rotate_copy.h +++ b/libcxx/include/__algorithm/rotate_copy.h @@ -9,10 +9,8 @@ #ifndef _LIBCPP___ALGORITHM_ROTATE_COPY_H #define _LIBCPP___ALGORITHM_ROTATE_COPY_H -#include <__config> #include <__algorithm/copy.h> -#include -#include +#include <__config> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__algorithm/search_n.h b/libcxx/include/__algorithm/search_n.h --- a/libcxx/include/__algorithm/search_n.h +++ b/libcxx/include/__algorithm/search_n.h @@ -10,8 +10,8 @@ #ifndef _LIBCPP___ALGORITHM_SEARCH_N_H #define _LIBCPP___ALGORITHM_SEARCH_N_H -#include <__config> #include <__algorithm/comp.h> +#include <__config> #include <__iterator/iterator_traits.h> #include // __convert_to_integral diff --git a/libcxx/include/__algorithm/set_difference.h b/libcxx/include/__algorithm/set_difference.h --- a/libcxx/include/__algorithm/set_difference.h +++ b/libcxx/include/__algorithm/set_difference.h @@ -9,10 +9,10 @@ #ifndef _LIBCPP___ALGORITHM_SET_DIFFERENCE_H #define _LIBCPP___ALGORITHM_SET_DIFFERENCE_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/comp_ref_type.h> #include <__algorithm/copy.h> +#include <__config> #include <__iterator/iterator_traits.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/set_intersection.h b/libcxx/include/__algorithm/set_intersection.h --- a/libcxx/include/__algorithm/set_intersection.h +++ b/libcxx/include/__algorithm/set_intersection.h @@ -9,9 +9,9 @@ #ifndef _LIBCPP___ALGORITHM_SET_INTERSECTION_H #define _LIBCPP___ALGORITHM_SET_INTERSECTION_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/comp_ref_type.h> +#include <__config> #include <__iterator/iterator_traits.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/set_symmetric_difference.h b/libcxx/include/__algorithm/set_symmetric_difference.h --- a/libcxx/include/__algorithm/set_symmetric_difference.h +++ b/libcxx/include/__algorithm/set_symmetric_difference.h @@ -9,10 +9,10 @@ #ifndef _LIBCPP___ALGORITHM_SET_SYMMETRIC_DIFFERENCE_H #define _LIBCPP___ALGORITHM_SET_SYMMETRIC_DIFFERENCE_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/comp_ref_type.h> #include <__algorithm/copy.h> +#include <__config> #include <__iterator/iterator_traits.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/set_union.h b/libcxx/include/__algorithm/set_union.h --- a/libcxx/include/__algorithm/set_union.h +++ b/libcxx/include/__algorithm/set_union.h @@ -9,10 +9,10 @@ #ifndef _LIBCPP___ALGORITHM_SET_UNION_H #define _LIBCPP___ALGORITHM_SET_UNION_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/comp_ref_type.h> #include <__algorithm/copy.h> +#include <__config> #include <__iterator/iterator_traits.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/shift_left.h b/libcxx/include/__algorithm/shift_left.h --- a/libcxx/include/__algorithm/shift_left.h +++ b/libcxx/include/__algorithm/shift_left.h @@ -9,10 +9,10 @@ #ifndef _LIBCPP___ALGORITHM_SHIFT_LEFT_H #define _LIBCPP___ALGORITHM_SHIFT_LEFT_H -#include <__config> #include <__algorithm/move.h> +#include <__config> #include <__iterator/iterator_traits.h> -#include // swap +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__algorithm/shift_right.h b/libcxx/include/__algorithm/shift_right.h --- a/libcxx/include/__algorithm/shift_right.h +++ b/libcxx/include/__algorithm/shift_right.h @@ -9,12 +9,13 @@ #ifndef _LIBCPP___ALGORITHM_SHIFT_RIGHT_H #define _LIBCPP___ALGORITHM_SHIFT_RIGHT_H -#include <__config> #include <__algorithm/move.h> #include <__algorithm/move_backward.h> #include <__algorithm/swap_ranges.h> +#include <__config> #include <__iterator/iterator_traits.h> -#include // swap +#include <__utility/swap.h> +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__algorithm/sort.h b/libcxx/include/__algorithm/sort.h --- a/libcxx/include/__algorithm/sort.h +++ b/libcxx/include/__algorithm/sort.h @@ -9,12 +9,12 @@ #ifndef _LIBCPP___ALGORITHM_SORT_H #define _LIBCPP___ALGORITHM_SORT_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/comp_ref_type.h> #include <__algorithm/min_element.h> #include <__algorithm/partial_sort.h> #include <__algorithm/unwrap_iter.h> +#include <__config> #include <__utility/swap.h> #include diff --git a/libcxx/include/__algorithm/sort_heap.h b/libcxx/include/__algorithm/sort_heap.h --- a/libcxx/include/__algorithm/sort_heap.h +++ b/libcxx/include/__algorithm/sort_heap.h @@ -9,10 +9,10 @@ #ifndef _LIBCPP___ALGORITHM_SORT_HEAP_H #define _LIBCPP___ALGORITHM_SORT_HEAP_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/comp_ref_type.h> #include <__algorithm/pop_heap.h> +#include <__config> #include <__iterator/iterator_traits.h> #include // swap diff --git a/libcxx/include/__algorithm/stable_partition.h b/libcxx/include/__algorithm/stable_partition.h --- a/libcxx/include/__algorithm/stable_partition.h +++ b/libcxx/include/__algorithm/stable_partition.h @@ -9,8 +9,8 @@ #ifndef _LIBCPP___ALGORITHM_STABLE_PARTITION_H #define _LIBCPP___ALGORITHM_STABLE_PARTITION_H -#include <__config> #include <__algorithm/rotate.h> +#include <__config> #include <__iterator/iterator_traits.h> #include <__utility/swap.h> #include diff --git a/libcxx/include/__algorithm/stable_sort.h b/libcxx/include/__algorithm/stable_sort.h --- a/libcxx/include/__algorithm/stable_sort.h +++ b/libcxx/include/__algorithm/stable_sort.h @@ -9,15 +9,15 @@ #ifndef _LIBCPP___ALGORITHM_STABLE_SORT_H #define _LIBCPP___ALGORITHM_STABLE_SORT_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/comp_ref_type.h> #include <__algorithm/inplace_merge.h> #include <__algorithm/sort.h> +#include <__config> #include <__iterator/iterator_traits.h> #include <__utility/swap.h> #include -#include // swap +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__algorithm/unique.h b/libcxx/include/__algorithm/unique.h --- a/libcxx/include/__algorithm/unique.h +++ b/libcxx/include/__algorithm/unique.h @@ -9,9 +9,9 @@ #ifndef _LIBCPP___ALGORITHM_UNIQUE_H #define _LIBCPP___ALGORITHM_UNIQUE_H -#include <__config> -#include <__algorithm/comp.h> #include <__algorithm/adjacent_find.h> +#include <__algorithm/comp.h> +#include <__config> #include <__iterator/iterator_traits.h> #include <__utility/move.h> diff --git a/libcxx/include/__algorithm/unique_copy.h b/libcxx/include/__algorithm/unique_copy.h --- a/libcxx/include/__algorithm/unique_copy.h +++ b/libcxx/include/__algorithm/unique_copy.h @@ -9,8 +9,8 @@ #ifndef _LIBCPP___ALGORITHM_UNIQUE_COPY_H #define _LIBCPP___ALGORITHM_UNIQUE_COPY_H -#include <__config> #include <__algorithm/comp.h> +#include <__config> #include <__iterator/iterator_traits.h> #include diff --git a/libcxx/include/__algorithm/unwrap_iter.h b/libcxx/include/__algorithm/unwrap_iter.h --- a/libcxx/include/__algorithm/unwrap_iter.h +++ b/libcxx/include/__algorithm/unwrap_iter.h @@ -10,8 +10,8 @@ #define _LIBCPP___ALGORITHM_UNWRAP_ITER_H #include <__config> -#include #include <__memory/pointer_traits.h> +#include #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__algorithm/upper_bound.h b/libcxx/include/__algorithm/upper_bound.h --- a/libcxx/include/__algorithm/upper_bound.h +++ b/libcxx/include/__algorithm/upper_bound.h @@ -9,9 +9,9 @@ #ifndef _LIBCPP___ALGORITHM_UPPER_BOUND_H #define _LIBCPP___ALGORITHM_UPPER_BOUND_H -#include <__config> #include <__algorithm/comp.h> #include <__algorithm/half_positive.h> +#include <__config> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__bit_reference b/libcxx/include/__bit_reference --- a/libcxx/include/__bit_reference +++ b/libcxx/include/__bit_reference @@ -10,8 +10,8 @@ #ifndef _LIBCPP___BIT_REFERENCE #define _LIBCPP___BIT_REFERENCE -#include <__config> #include <__bits> +#include <__config> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__compare/compare_three_way.h b/libcxx/include/__compare/compare_three_way.h --- a/libcxx/include/__compare/compare_three_way.h +++ b/libcxx/include/__compare/compare_three_way.h @@ -10,8 +10,8 @@ #ifndef _LIBCPP___COMPARE_COMPARE_THREE_WAY_H #define _LIBCPP___COMPARE_COMPARE_THREE_WAY_H -#include <__config> #include <__compare/three_way_comparable.h> +#include <__config> #include <__utility/forward.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__compare/synth_three_way.h b/libcxx/include/__compare/synth_three_way.h --- a/libcxx/include/__compare/synth_three_way.h +++ b/libcxx/include/__compare/synth_three_way.h @@ -9,10 +9,10 @@ #ifndef _LIBCPP___COMPARE_SYNTH_THREE_WAY_H #define _LIBCPP___COMPARE_SYNTH_THREE_WAY_H -#include <__config> #include <__compare/ordering.h> #include <__compare/three_way_comparable.h> #include <__concepts/boolean_testable.h> +#include <__config> #include <__utility/declval.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__filesystem/directory_entry.h b/libcxx/include/__filesystem/directory_entry.h --- a/libcxx/include/__filesystem/directory_entry.h +++ b/libcxx/include/__filesystem/directory_entry.h @@ -12,14 +12,14 @@ #include <__availability> #include <__config> -#include <__filesystem/path.h> -#include <__filesystem/file_time_type.h> -#include <__filesystem/filesystem_error.h> +#include <__errc> #include <__filesystem/file_status.h> +#include <__filesystem/file_time_type.h> #include <__filesystem/file_type.h> +#include <__filesystem/filesystem_error.h> #include <__filesystem/operations.h> +#include <__filesystem/path.h> #include <__filesystem/perms.h> -#include <__errc> #include #include #include diff --git a/libcxx/include/__filesystem/directory_iterator.h b/libcxx/include/__filesystem/directory_iterator.h --- a/libcxx/include/__filesystem/directory_iterator.h +++ b/libcxx/include/__filesystem/directory_iterator.h @@ -12,12 +12,12 @@ #include <__availability> #include <__config> +#include <__debug> #include <__filesystem/directory_entry.h> #include <__filesystem/directory_options.h> #include <__filesystem/path.h> #include <__iterator/iterator_traits.h> #include <__memory/shared_ptr.h> -#include <__debug> #include <__ranges/enable_borrowed_range.h> #include <__ranges/enable_view.h> #include diff --git a/libcxx/include/__filesystem/filesystem_error.h b/libcxx/include/__filesystem/filesystem_error.h --- a/libcxx/include/__filesystem/filesystem_error.h +++ b/libcxx/include/__filesystem/filesystem_error.h @@ -14,9 +14,9 @@ #include <__config> #include <__filesystem/path.h> #include <__memory/shared_ptr.h> -#include #include #include +#include #include #ifndef _LIBCPP_CXX03_LANG diff --git a/libcxx/include/__filesystem/path.h b/libcxx/include/__filesystem/path.h --- a/libcxx/include/__filesystem/path.h +++ b/libcxx/include/__filesystem/path.h @@ -12,16 +12,16 @@ #include <__availability> #include <__config> -#include -#include #include <__iterator/back_insert_iterator.h> #include <__iterator/iterator_traits.h> #include +#include #include +#include #if !defined(_LIBCPP_HAS_NO_LOCALIZATION) -# include # include // for quoted +# include #endif #ifndef _LIBCPP_CXX03_LANG diff --git a/libcxx/include/__filesystem/path_iterator.h b/libcxx/include/__filesystem/path_iterator.h --- a/libcxx/include/__filesystem/path_iterator.h +++ b/libcxx/include/__filesystem/path_iterator.h @@ -12,9 +12,9 @@ #include <__availability> #include <__config> +#include <__debug> #include <__filesystem/path.h> #include <__iterator/iterator_traits.h> -#include <__debug> #include #include #include diff --git a/libcxx/include/__format/formatter_integral.h b/libcxx/include/__format/formatter_integral.h --- a/libcxx/include/__format/formatter_integral.h +++ b/libcxx/include/__format/formatter_integral.h @@ -10,15 +10,15 @@ #ifndef _LIBCPP___FORMAT_FORMATTER_INTEGRAL_H #define _LIBCPP___FORMAT_FORMATTER_INTEGRAL_H +#include <__algorithm/copy.h> +#include <__algorithm/copy_n.h> +#include <__algorithm/fill_n.h> +#include <__algorithm/transform.h> #include <__config> #include <__format/format_error.h> #include <__format/format_fwd.h> #include <__format/formatter.h> #include <__format/parser_std_format_spec.h> -#include <__algorithm/copy.h> -#include <__algorithm/copy_n.h> -#include <__algorithm/fill_n.h> -#include <__algorithm/transform.h> #include #include #include diff --git a/libcxx/include/__functional/bind.h b/libcxx/include/__functional/bind.h --- a/libcxx/include/__functional/bind.h +++ b/libcxx/include/__functional/bind.h @@ -11,8 +11,8 @@ #define _LIBCPP___FUNCTIONAL_BIND_H #include <__config> -#include <__functional/weak_result_type.h> #include <__functional/invoke.h> +#include <__functional/weak_result_type.h> #include #include #include diff --git a/libcxx/include/__functional/bind_front.h b/libcxx/include/__functional/bind_front.h --- a/libcxx/include/__functional/bind_front.h +++ b/libcxx/include/__functional/bind_front.h @@ -11,8 +11,8 @@ #define _LIBCPP___FUNCTIONAL_BIND_FRONT_H #include <__config> -#include <__functional/perfect_forward.h> #include <__functional/invoke.h> +#include <__functional/perfect_forward.h> #include #include diff --git a/libcxx/include/__functional/hash.h b/libcxx/include/__functional/hash.h --- a/libcxx/include/__functional/hash.h +++ b/libcxx/include/__functional/hash.h @@ -16,9 +16,9 @@ #include <__utility/move.h> #include <__utility/pair.h> #include <__utility/swap.h> +#include #include #include -#include #include #include diff --git a/libcxx/include/__functional/mem_fn.h b/libcxx/include/__functional/mem_fn.h --- a/libcxx/include/__functional/mem_fn.h +++ b/libcxx/include/__functional/mem_fn.h @@ -11,9 +11,9 @@ #define _LIBCPP___FUNCTIONAL_MEM_FN_H #include <__config> -#include <__functional/weak_result_type.h> #include <__functional/binary_function.h> #include <__functional/invoke.h> +#include <__functional/weak_result_type.h> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__functional/mem_fun_ref.h b/libcxx/include/__functional/mem_fun_ref.h --- a/libcxx/include/__functional/mem_fun_ref.h +++ b/libcxx/include/__functional/mem_fun_ref.h @@ -11,8 +11,8 @@ #define _LIBCPP___FUNCTIONAL_MEM_FUN_REF_H #include <__config> -#include <__functional/unary_function.h> #include <__functional/binary_function.h> +#include <__functional/unary_function.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__functional/not_fn.h b/libcxx/include/__functional/not_fn.h --- a/libcxx/include/__functional/not_fn.h +++ b/libcxx/include/__functional/not_fn.h @@ -11,8 +11,8 @@ #define _LIBCPP___FUNCTIONAL_NOT_FN_H #include <__config> -#include <__functional/perfect_forward.h> #include <__functional/invoke.h> +#include <__functional/perfect_forward.h> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__iterator/advance.h b/libcxx/include/__iterator/advance.h --- a/libcxx/include/__iterator/advance.h +++ b/libcxx/include/__iterator/advance.h @@ -17,8 +17,8 @@ #include <__iterator/incrementable_traits.h> #include <__iterator/iterator_traits.h> #include <__utility/move.h> -#include #include +#include #include #include diff --git a/libcxx/include/__iterator/counted_iterator.h b/libcxx/include/__iterator/counted_iterator.h --- a/libcxx/include/__iterator/counted_iterator.h +++ b/libcxx/include/__iterator/counted_iterator.h @@ -13,9 +13,9 @@ #include <__debug> #include <__iterator/concepts.h> #include <__iterator/default_sentinel.h> +#include <__iterator/incrementable_traits.h> #include <__iterator/iter_move.h> #include <__iterator/iter_swap.h> -#include <__iterator/incrementable_traits.h> #include <__iterator/iterator_traits.h> #include <__iterator/readable_traits.h> #include <__memory/pointer_traits.h> diff --git a/libcxx/include/__iterator/reverse_iterator.h b/libcxx/include/__iterator/reverse_iterator.h --- a/libcxx/include/__iterator/reverse_iterator.h +++ b/libcxx/include/__iterator/reverse_iterator.h @@ -10,9 +10,9 @@ #ifndef _LIBCPP___ITERATOR_REVERSE_ITERATOR_H #define _LIBCPP___ITERATOR_REVERSE_ITERATOR_H -#include <__config> #include <__compare/compare_three_way_result.h> #include <__compare/three_way_comparable.h> +#include <__config> #include <__iterator/iterator.h> #include <__iterator/iterator_traits.h> #include <__memory/addressof.h> diff --git a/libcxx/include/__locale b/libcxx/include/__locale --- a/libcxx/include/__locale +++ b/libcxx/include/__locale @@ -12,13 +12,14 @@ #include <__availability> #include <__config> -#include -#include -#include -#include -#include #include +#include #include +#include +#include +#include +#include + #if defined(_LIBCPP_MSVCRT_LIKE) # include # include <__support/win32/locale_win32.h> diff --git a/libcxx/include/__memory/shared_ptr.h b/libcxx/include/__memory/shared_ptr.h --- a/libcxx/include/__memory/shared_ptr.h +++ b/libcxx/include/__memory/shared_ptr.h @@ -12,14 +12,14 @@ #include <__availability> #include <__config> -#include <__functional_base> #include <__functional/binary_function.h> #include <__functional/operations.h> #include <__functional/reference_wrapper.h> +#include <__functional_base> #include <__memory/addressof.h> #include <__memory/allocation_guard.h> -#include <__memory/allocator_traits.h> #include <__memory/allocator.h> +#include <__memory/allocator_traits.h> #include <__memory/compressed_pair.h> #include <__memory/pointer_traits.h> #include <__memory/unique_ptr.h> @@ -28,8 +28,8 @@ #include // abort #include #include -#include #include +#include #include #if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER) # include diff --git a/libcxx/include/__memory/unique_ptr.h b/libcxx/include/__memory/unique_ptr.h --- a/libcxx/include/__memory/unique_ptr.h +++ b/libcxx/include/__memory/unique_ptr.h @@ -11,9 +11,9 @@ #define _LIBCPP___MEMORY_UNIQUE_PTR_H #include <__config> -#include <__functional_base> #include <__functional/hash.h> #include <__functional/operations.h> +#include <__functional_base> #include <__memory/allocator_traits.h> // __pointer #include <__memory/compressed_pair.h> #include <__utility/forward.h> diff --git a/libcxx/include/__random/chi_squared_distribution.h b/libcxx/include/__random/chi_squared_distribution.h --- a/libcxx/include/__random/chi_squared_distribution.h +++ b/libcxx/include/__random/chi_squared_distribution.h @@ -11,8 +11,8 @@ #include <__config> #include <__random/gamma_distribution.h> -#include #include +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/__random/gamma_distribution.h b/libcxx/include/__random/gamma_distribution.h --- a/libcxx/include/__random/gamma_distribution.h +++ b/libcxx/include/__random/gamma_distribution.h @@ -10,8 +10,8 @@ #define _LIBCPP___RANDOM_GAMMA_DISTRIBUTION_H #include <__config> -#include <__random/uniform_real_distribution.h> #include <__random/exponential_distribution.h> +#include <__random/uniform_real_distribution.h> #include #include #include diff --git a/libcxx/include/__ranges/single_view.h b/libcxx/include/__ranges/single_view.h --- a/libcxx/include/__ranges/single_view.h +++ b/libcxx/include/__ranges/single_view.h @@ -10,8 +10,8 @@ #define _LIBCPP___RANGES_SINGLE_VIEW_H #include <__config> -#include <__ranges/view_interface.h> #include <__ranges/copyable_box.h> +#include <__ranges/view_interface.h> #include <__utility/forward.h> #include <__utility/in_place.h> #include <__utility/move.h> diff --git a/libcxx/include/__string b/libcxx/include/__string --- a/libcxx/include/__string +++ b/libcxx/include/__string @@ -10,21 +10,21 @@ #ifndef _LIBCPP___STRING #define _LIBCPP___STRING -#include <__config> #include <__algorithm/copy.h> #include <__algorithm/copy_backward.h> #include <__algorithm/copy_n.h> #include <__algorithm/fill_n.h> -#include <__algorithm/find_first_of.h> #include <__algorithm/find_end.h> +#include <__algorithm/find_first_of.h> #include <__algorithm/min.h> +#include <__config> #include <__functional/hash.h> // for __murmur2_or_cityhash #include <__iterator/iterator_traits.h> -#include // for EOF #include // for uint_least16_t +#include // for EOF #include // for memcpy -#include // for __libcpp_is_constant_evaluated #include // for streampos & friends +#include // for __libcpp_is_constant_evaluated #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS # include // for wmemcpy diff --git a/libcxx/include/__utility/swap.h b/libcxx/include/__utility/swap.h --- a/libcxx/include/__utility/swap.h +++ b/libcxx/include/__utility/swap.h @@ -12,8 +12,8 @@ #include <__config> #include <__utility/declval.h> #include <__utility/move.h> -#include #include +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm --- a/libcxx/include/algorithm +++ b/libcxx/include/algorithm @@ -673,8 +673,8 @@ #include <__algorithm/count_if.h> #include <__algorithm/equal.h> #include <__algorithm/equal_range.h> -#include <__algorithm/fill_n.h> #include <__algorithm/fill.h> +#include <__algorithm/fill_n.h> #include <__algorithm/find.h> #include <__algorithm/find_end.h> #include <__algorithm/find_first_of.h> @@ -682,8 +682,8 @@ #include <__algorithm/find_if_not.h> #include <__algorithm/for_each.h> #include <__algorithm/for_each_n.h> -#include <__algorithm/generate_n.h> #include <__algorithm/generate.h> +#include <__algorithm/generate_n.h> #include <__algorithm/half_positive.h> #include <__algorithm/includes.h> #include <__algorithm/inplace_merge.h> @@ -747,8 +747,8 @@ #include <__algorithm/stable_sort.h> #include <__algorithm/swap_ranges.h> #include <__algorithm/transform.h> -#include <__algorithm/unique_copy.h> #include <__algorithm/unique.h> +#include <__algorithm/unique_copy.h> #include <__algorithm/unwrap_iter.h> #include <__algorithm/upper_bound.h> diff --git a/libcxx/include/bitset b/libcxx/include/bitset --- a/libcxx/include/bitset +++ b/libcxx/include/bitset @@ -112,8 +112,8 @@ */ -#include <__config> #include <__bit_reference> +#include <__config> #include <__functional_base> #include #include diff --git a/libcxx/include/cmath b/libcxx/include/cmath --- a/libcxx/include/cmath +++ b/libcxx/include/cmath @@ -306,8 +306,8 @@ #include <__config> #include -#include #include +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/coroutine b/libcxx/include/coroutine --- a/libcxx/include/coroutine +++ b/libcxx/include/coroutine @@ -40,8 +40,8 @@ #include <__config> #include <__coroutine/coroutine_handle.h> -#include <__coroutine/noop_coroutine_handle.h> #include <__coroutine/coroutine_traits.h> +#include <__coroutine/noop_coroutine_handle.h> #include <__coroutine/trivial_awaitables.h> #include diff --git a/libcxx/include/experimental/__memory b/libcxx/include/experimental/__memory --- a/libcxx/include/experimental/__memory +++ b/libcxx/include/experimental/__memory @@ -10,11 +10,11 @@ #ifndef _LIBCPP_EXPERIMENTAL___MEMORY #define _LIBCPP_EXPERIMENTAL___MEMORY +#include <__functional_base> #include <__memory/allocator_arg_t.h> #include <__memory/uses_allocator.h> #include #include // for erased_type -#include <__functional_base> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/experimental/algorithm b/libcxx/include/experimental/algorithm --- a/libcxx/include/experimental/algorithm +++ b/libcxx/include/experimental/algorithm @@ -31,12 +31,11 @@ */ -#include +#include <__debug> #include +#include #include -#include <__debug> - #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif diff --git a/libcxx/include/experimental/coroutine b/libcxx/include/experimental/coroutine --- a/libcxx/include/experimental/coroutine +++ b/libcxx/include/experimental/coroutine @@ -45,13 +45,13 @@ */ +#include <__debug> +#include #include -#include -#include #include #include // for hash -#include -#include <__debug> +#include +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/experimental/deque b/libcxx/include/experimental/deque --- a/libcxx/include/experimental/deque +++ b/libcxx/include/experimental/deque @@ -28,8 +28,8 @@ */ -#include #include +#include #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/experimental/forward_list b/libcxx/include/experimental/forward_list --- a/libcxx/include/experimental/forward_list +++ b/libcxx/include/experimental/forward_list @@ -29,8 +29,8 @@ */ #include -#include #include +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/experimental/functional b/libcxx/include/experimental/functional --- a/libcxx/include/experimental/functional +++ b/libcxx/include/experimental/functional @@ -86,16 +86,15 @@ */ +#include <__debug> #include <__memory/uses_allocator.h> +#include +#include #include #include -#include #include -#include -#include #include - -#include <__debug> +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -104,7 +103,6 @@ _LIBCPP_PUSH_MACROS #include <__undef_macros> - _LIBCPP_BEGIN_NAMESPACE_LFTS #if _LIBCPP_STD_VER > 11 diff --git a/libcxx/include/experimental/iterator b/libcxx/include/experimental/iterator --- a/libcxx/include/experimental/iterator +++ b/libcxx/include/experimental/iterator @@ -53,8 +53,8 @@ */ #include <__memory/addressof.h> -#include <__utility/move.h> #include <__utility/forward.h> +#include <__utility/move.h> #include #include diff --git a/libcxx/include/experimental/list b/libcxx/include/experimental/list --- a/libcxx/include/experimental/list +++ b/libcxx/include/experimental/list @@ -29,8 +29,8 @@ */ #include -#include #include +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/experimental/map b/libcxx/include/experimental/map --- a/libcxx/include/experimental/map +++ b/libcxx/include/experimental/map @@ -34,8 +34,8 @@ */ #include -#include #include +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/experimental/memory_resource b/libcxx/include/experimental/memory_resource --- a/libcxx/include/experimental/memory_resource +++ b/libcxx/include/experimental/memory_resource @@ -64,18 +64,18 @@ */ +#include <__debug> +#include <__tuple> +#include +#include #include #include #include #include #include #include -#include <__tuple> #include #include -#include -#include -#include <__debug> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/experimental/propagate_const b/libcxx/include/experimental/propagate_const --- a/libcxx/include/experimental/propagate_const +++ b/libcxx/include/experimental/propagate_const @@ -107,19 +107,18 @@ */ #include +#include +#include +#include + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif #if _LIBCPP_STD_VER > 11 -#include -#include -#include - _LIBCPP_BEGIN_NAMESPACE_LFTS_V2 - template class propagate_const; diff --git a/libcxx/include/experimental/regex b/libcxx/include/experimental/regex --- a/libcxx/include/experimental/regex +++ b/libcxx/include/experimental/regex @@ -36,9 +36,9 @@ */ #include -#include -#include #include +#include +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/experimental/set b/libcxx/include/experimental/set --- a/libcxx/include/experimental/set +++ b/libcxx/include/experimental/set @@ -34,8 +34,8 @@ */ #include -#include #include +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/experimental/simd b/libcxx/include/experimental/simd --- a/libcxx/include/experimental/simd +++ b/libcxx/include/experimental/simd @@ -649,10 +649,10 @@ */ -#include #include #include #include +#include #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/experimental/string b/libcxx/include/experimental/string --- a/libcxx/include/experimental/string +++ b/libcxx/include/experimental/string @@ -38,8 +38,8 @@ */ #include -#include #include +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/experimental/unordered_map b/libcxx/include/experimental/unordered_map --- a/libcxx/include/experimental/unordered_map +++ b/libcxx/include/experimental/unordered_map @@ -40,8 +40,8 @@ */ #include -#include #include +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/experimental/unordered_set b/libcxx/include/experimental/unordered_set --- a/libcxx/include/experimental/unordered_set +++ b/libcxx/include/experimental/unordered_set @@ -34,8 +34,8 @@ */ #include -#include #include +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/experimental/vector b/libcxx/include/experimental/vector --- a/libcxx/include/experimental/vector +++ b/libcxx/include/experimental/vector @@ -29,8 +29,8 @@ */ #include -#include #include +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/ext/__hash b/libcxx/include/ext/__hash --- a/libcxx/include/ext/__hash +++ b/libcxx/include/ext/__hash @@ -13,8 +13,8 @@ #pragma GCC system_header #include <__string> -#include #include +#include namespace __gnu_cxx { diff --git a/libcxx/include/ext/hash_map b/libcxx/include/ext/hash_map --- a/libcxx/include/ext/hash_map +++ b/libcxx/include/ext/hash_map @@ -203,10 +203,10 @@ #include <__config> #include <__hash_table> +#include #include #include #include -#include #if defined(__DEPRECATED) && __DEPRECATED #if defined(_LIBCPP_WARNING) diff --git a/libcxx/include/ext/hash_set b/libcxx/include/ext/hash_set --- a/libcxx/include/ext/hash_set +++ b/libcxx/include/ext/hash_set @@ -194,8 +194,8 @@ #include <__config> #include <__hash_table> -#include #include +#include #if defined(__DEPRECATED) && __DEPRECATED #if defined(_LIBCPP_WARNING) diff --git a/libcxx/include/filesystem b/libcxx/include/filesystem --- a/libcxx/include/filesystem +++ b/libcxx/include/filesystem @@ -248,8 +248,8 @@ #include <__filesystem/file_type.h> #include <__filesystem/filesystem_error.h> #include <__filesystem/operations.h> -#include <__filesystem/path_iterator.h> #include <__filesystem/path.h> +#include <__filesystem/path_iterator.h> #include <__filesystem/perm_options.h> #include <__filesystem/perms.h> #include <__filesystem/recursive_directory_iterator.h> diff --git a/libcxx/include/functional b/libcxx/include/functional --- a/libcxx/include/functional +++ b/libcxx/include/functional @@ -496,9 +496,9 @@ #include <__debug> #include <__functional/binary_function.h> // TODO: deprecate #include <__functional/binary_negate.h> +#include <__functional/bind.h> #include <__functional/bind_back.h> #include <__functional/bind_front.h> -#include <__functional/bind.h> #include <__functional/binder1st.h> #include <__functional/binder2nd.h> #include <__functional/compose.h> diff --git a/libcxx/include/iterator b/libcxx/include/iterator --- a/libcxx/include/iterator +++ b/libcxx/include/iterator @@ -600,16 +600,16 @@ #include <__iterator/incrementable_traits.h> #include <__iterator/indirectly_comparable.h> #include <__iterator/insert_iterator.h> -#include <__iterator/istreambuf_iterator.h> #include <__iterator/istream_iterator.h> -#include <__iterator/iterator.h> -#include <__iterator/iterator_traits.h> +#include <__iterator/istreambuf_iterator.h> #include <__iterator/iter_move.h> #include <__iterator/iter_swap.h> +#include <__iterator/iterator.h> +#include <__iterator/iterator_traits.h> #include <__iterator/move_iterator.h> #include <__iterator/next.h> -#include <__iterator/ostreambuf_iterator.h> #include <__iterator/ostream_iterator.h> +#include <__iterator/ostreambuf_iterator.h> #include <__iterator/prev.h> #include <__iterator/projected.h> #include <__iterator/readable_traits.h> diff --git a/libcxx/include/math.h b/libcxx/include/math.h --- a/libcxx/include/math.h +++ b/libcxx/include/math.h @@ -305,9 +305,9 @@ // back to C++ linkage before including these C++ headers. extern "C++" { +#include #include #include -#include // signbit diff --git a/libcxx/include/ranges b/libcxx/include/ranges --- a/libcxx/include/ranges +++ b/libcxx/include/ranges @@ -207,8 +207,8 @@ #include <__ranges/dangling.h> #include <__ranges/data.h> #include <__ranges/drop_view.h> -#include <__ranges/empty_view.h> #include <__ranges/empty.h> +#include <__ranges/empty_view.h> #include <__ranges/enable_borrowed_range.h> #include <__ranges/enable_view.h> #include <__ranges/iota_view.h> diff --git a/libcxx/include/stdexcept b/libcxx/include/stdexcept --- a/libcxx/include/stdexcept +++ b/libcxx/include/stdexcept @@ -42,9 +42,9 @@ */ #include <__config> +#include #include #include // for string forward decl -#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map --- a/libcxx/include/unordered_map +++ b/libcxx/include/unordered_map @@ -517,8 +517,8 @@ #include <__config> #include <__debug> #include <__functional/is_transparent.h> -#include <__iterator/iterator_traits.h> #include <__hash_table> +#include <__iterator/iterator_traits.h> #include <__node_handle> #include <__utility/forward.h> #include diff --git a/libcxx/include/vector b/libcxx/include/vector --- a/libcxx/include/vector +++ b/libcxx/include/vector @@ -271,8 +271,8 @@ */ -#include <__config> #include <__bit_reference> +#include <__config> #include <__debug> #include <__functional_base> #include <__iterator/iterator_traits.h> diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot --- a/libcxx/utils/ci/run-buildbot +++ b/libcxx/utils/ci/run-buildbot @@ -186,7 +186,8 @@ ! grep -rn '[^ -~]' libcxx/include/ || false # Reject patches that introduce dependency cycles in the headers. - python3 libcxx/utils/graph_header_deps.py >/dev/null + # Also, reject patches with misalphabetized include directives. + python3 libcxx/utils/graph_header_deps.py --check-libcxx-invariants >/dev/null ;; generic-cxx03) clean diff --git a/libcxx/utils/graph_header_deps.py b/libcxx/utils/graph_header_deps.py --- a/libcxx/utils/graph_header_deps.py +++ b/libcxx/utils/graph_header_deps.py @@ -14,7 +14,7 @@ def is_config_header(h): - return os.path.basename(h) in ['__config', '__libcpp_version', '__undef_macros', 'version'] + return os.path.basename(h) in ['__config', '__debug', '__libcpp_version', '__undef_macros', 'version'] def is_experimental_header(h): @@ -60,6 +60,8 @@ local_includes = [] system_includes = [] + longest_run = (0, 0) + current_run = 0 linecount = 0 with open(fname, 'r', encoding='utf-8') as f: for line in f.readlines(): @@ -70,6 +72,20 @@ m = re.match(r'\s*#\s*include\s+<([^>]*)>', line) if m is not None: system_includes.append(m.group(1)) + current_run += 1 + else: + if current_run > longest_run[0]: + longest_run = (current_run, len(system_includes) - current_run) + current_run = 0 + + if options.check_libcxx_invariants and not (is_config_header(fname) or is_support_header(fname)): + relevant_includes = system_includes[longest_run[1]:][:longest_run[0]] + if relevant_includes != sorted(relevant_includes): + raise RuntimeError('Header %s #includes are out of alphabetical order: <%s> should be <%s>' % ( + fname, + [a for (a, b) in zip(relevant_includes, sorted(relevant_includes)) if a != b][0], + [b for (a, b) in zip(relevant_includes, sorted(relevant_includes)) if a != b][0] + )) fully_qualified_includes = [ locate_header_file(h, options.search_dirs) @@ -168,6 +184,7 @@ parser.add_argument('--show-support-headers', action='store_true', help='Show headers in the __support/ directory') parser.add_argument('--show-individual-line-counts', action='store_true', help='Include an individual line count in each node') parser.add_argument('--show-cumulative-line-counts', action='store_true', help='Include a total line count in each node') + parser.add_argument('--check-libcxx-invariants', action='store_true', help='Enforce a-z order for #includes') parser.add_argument('--error-on-file-not-found', action='store_true', help="Don't ignore failure to open an #included file") options = parser.parse_args()