Index: libcxx/include/__algorithm/adjacent_find.h =================================================================== --- libcxx/include/__algorithm/adjacent_find.h +++ libcxx/include/__algorithm/adjacent_find.h @@ -20,6 +20,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -50,4 +53,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ALGORITHM_ADJACENT_FIND_H Index: libcxx/include/__algorithm/in_out_result.h =================================================================== --- libcxx/include/__algorithm/in_out_result.h +++ libcxx/include/__algorithm/in_out_result.h @@ -18,6 +18,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 20 @@ -50,4 +53,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ALGORITHM_IN_OUT_RESULT_H Index: libcxx/include/__algorithm/is_permutation.h =================================================================== --- libcxx/include/__algorithm/is_permutation.h +++ libcxx/include/__algorithm/is_permutation.h @@ -26,6 +26,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -235,4 +238,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ALGORITHM_IS_PERMUTATION_H Index: libcxx/include/__algorithm/iterator_operations.h =================================================================== --- libcxx/include/__algorithm/iterator_operations.h +++ libcxx/include/__algorithm/iterator_operations.h @@ -33,6 +33,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template struct _IterOps; @@ -172,4 +175,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ALGORITHM_ITERATOR_OPERATIONS_H Index: libcxx/include/__algorithm/make_heap.h =================================================================== --- libcxx/include/__algorithm/make_heap.h +++ libcxx/include/__algorithm/make_heap.h @@ -21,6 +21,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -52,4 +55,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ALGORITHM_MAKE_HEAP_H Index: libcxx/include/__algorithm/min_element.h =================================================================== --- libcxx/include/__algorithm/min_element.h +++ libcxx/include/__algorithm/min_element.h @@ -22,6 +22,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -66,4 +69,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ALGORITHM_MIN_ELEMENT_H Index: libcxx/include/__algorithm/pop_heap.h =================================================================== --- libcxx/include/__algorithm/pop_heap.h +++ libcxx/include/__algorithm/pop_heap.h @@ -25,6 +25,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -70,4 +73,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ALGORITHM_POP_HEAP_H Index: libcxx/include/__algorithm/pstl_backends/cpu_backends/thread.h =================================================================== --- libcxx/include/__algorithm/pstl_backends/cpu_backends/thread.h +++ libcxx/include/__algorithm/pstl_backends/cpu_backends/thread.h @@ -23,6 +23,9 @@ // This backend implementation is for testing purposes only and not meant for production use. This will be replaced // by a proper implementation once the PSTL implementation is somewhat stable. +_LIBCPP_PUSH_MACROS +# include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD namespace __par_backend { @@ -68,6 +71,8 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_PSTL) && && _LIBCPP_STD_VER >= 17 #endif // _LIBCPP___ALGORITHM_PSTL_BACKENDS_CPU_BACKENDS_THREAD_H Index: libcxx/include/__algorithm/push_heap.h =================================================================== --- libcxx/include/__algorithm/push_heap.h +++ libcxx/include/__algorithm/push_heap.h @@ -22,6 +22,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -74,4 +77,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ALGORITHM_PUSH_HEAP_H Index: libcxx/include/__algorithm/sift_down.h =================================================================== --- libcxx/include/__algorithm/sift_down.h +++ libcxx/include/__algorithm/sift_down.h @@ -19,6 +19,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -111,4 +114,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ALGORITHM_SIFT_DOWN_H Index: libcxx/include/__algorithm/unwrap_iter.h =================================================================== --- libcxx/include/__algorithm/unwrap_iter.h +++ libcxx/include/__algorithm/unwrap_iter.h @@ -21,6 +21,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD // TODO: Change the name of __unwrap_iter_impl to something more appropriate @@ -79,4 +82,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_PUSH_MACROS + #endif // _LIBCPP___ALGORITHM_UNWRAP_ITER_H Index: libcxx/include/__algorithm/upper_bound.h =================================================================== --- libcxx/include/__algorithm/upper_bound.h +++ libcxx/include/__algorithm/upper_bound.h @@ -25,6 +25,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -60,4 +63,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ALGORITHM_UPPER_BOUND_H Index: libcxx/include/__concepts/swappable.h =================================================================== --- libcxx/include/__concepts/swappable.h +++ libcxx/include/__concepts/swappable.h @@ -28,6 +28,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 20 @@ -115,4 +118,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___CONCEPTS_SWAPPABLE_H Index: libcxx/include/__config =================================================================== --- libcxx/include/__config +++ libcxx/include/__config @@ -1164,8 +1164,10 @@ # define _LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS # endif // _LIBCPP_ENABLE_CXX20_REMOVED_FEATURES -# define _LIBCPP_PUSH_MACROS _Pragma("push_macro(\"min\")") _Pragma("push_macro(\"max\")") -# define _LIBCPP_POP_MACROS _Pragma("pop_macro(\"min\")") _Pragma("pop_macro(\"max\")") +// clang-format off +# define _LIBCPP_PUSH_MACROS _Pragma("push_macro(\"min\")") _Pragma("push_macro(\"max\")") _Pragma("push_macro(\"refresh()\")") _Pragma("push_macro(\"move(int, int)\")") _Pragma("push_macro(\"erase()\")") +# define _LIBCPP_POP_MACROS _Pragma("pop_macro(\"min\")") _Pragma("pop_macro(\"max\")") _Pragma("pop_macro(\"refresh()\")") _Pragma("pop_macro(\"move(int, int)\")") _Pragma("pop_macro(\"erase()\")") +// clang-format on # ifndef _LIBCPP_NO_AUTO_LINK # if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY) Index: libcxx/include/__expected/bad_expected_access.h =================================================================== --- libcxx/include/__expected/bad_expected_access.h +++ libcxx/include/__expected/bad_expected_access.h @@ -19,6 +19,9 @@ #if _LIBCPP_STD_VER >= 23 +_LIBCPP_PUSH_MACROS +# include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -58,6 +61,8 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP_STD_VER >= 23 #endif // _LIBCPP___EXPECTED_BAD_EXPECTED_ACCESS_H Index: libcxx/include/__expected/expected.h =================================================================== --- libcxx/include/__expected/expected.h +++ libcxx/include/__expected/expected.h @@ -60,6 +60,9 @@ #if _LIBCPP_STD_VER >= 23 +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -1543,6 +1546,8 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP_STD_VER >= 23 #endif // _LIBCPP___EXPECTED_EXPECTED_H Index: libcxx/include/__expected/unexpected.h =================================================================== --- libcxx/include/__expected/unexpected.h +++ libcxx/include/__expected/unexpected.h @@ -31,6 +31,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + #if _LIBCPP_STD_VER >= 23 _LIBCPP_BEGIN_NAMESPACE_STD @@ -119,4 +122,6 @@ #endif // _LIBCPP_STD_VER >= 23 +_LIBCPP_POP_MACROS + #endif // _LIBCPP___EXPECTED_UNEXPECTED_H Index: libcxx/include/__functional/perfect_forward.h =================================================================== --- libcxx/include/__functional/perfect_forward.h +++ libcxx/include/__functional/perfect_forward.h @@ -24,6 +24,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 17 @@ -94,4 +97,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___FUNCTIONAL_PERFECT_FORWARD_H Index: libcxx/include/__iterator/advance.h =================================================================== --- libcxx/include/__iterator/advance.h +++ libcxx/include/__iterator/advance.h @@ -29,6 +29,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -199,4 +202,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___ITERATOR_ADVANCE_H Index: libcxx/include/__iterator/back_insert_iterator.h =================================================================== --- libcxx/include/__iterator/back_insert_iterator.h +++ libcxx/include/__iterator/back_insert_iterator.h @@ -21,6 +21,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_SUPPRESS_DEPRECATED_PUSH Index: libcxx/include/__node_handle =================================================================== --- libcxx/include/__node_handle +++ libcxx/include/__node_handle @@ -68,6 +68,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 17 @@ -251,4 +254,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___NODE_HANDLE Index: libcxx/include/__numeric/accumulate.h =================================================================== --- libcxx/include/__numeric/accumulate.h +++ libcxx/include/__numeric/accumulate.h @@ -17,6 +17,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -49,4 +52,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___NUMERIC_ACCUMULATE_H Index: libcxx/include/__numeric/adjacent_difference.h =================================================================== --- libcxx/include/__numeric/adjacent_difference.h +++ libcxx/include/__numeric/adjacent_difference.h @@ -18,6 +18,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -69,4 +72,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___NUMERIC_ADJACENT_DIFFERENCE_H Index: libcxx/include/__numeric/exclusive_scan.h =================================================================== --- libcxx/include/__numeric/exclusive_scan.h +++ libcxx/include/__numeric/exclusive_scan.h @@ -18,6 +18,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 17 @@ -50,4 +53,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___NUMERIC_EXCLUSIVE_SCAN_H Index: libcxx/include/__numeric/inner_product.h =================================================================== --- libcxx/include/__numeric/inner_product.h +++ libcxx/include/__numeric/inner_product.h @@ -17,6 +17,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -50,4 +53,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___NUMERIC_INNER_PRODUCT_H Index: libcxx/include/__numeric/partial_sum.h =================================================================== --- libcxx/include/__numeric/partial_sum.h +++ libcxx/include/__numeric/partial_sum.h @@ -18,6 +18,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -67,4 +70,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___NUMERIC_PARTIAL_SUM_H Index: libcxx/include/__ranges/as_rvalue_view.h =================================================================== --- libcxx/include/__ranges/as_rvalue_view.h +++ libcxx/include/__ranges/as_rvalue_view.h @@ -28,6 +28,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + #if _LIBCPP_STD_VER >= 23 _LIBCPP_BEGIN_NAMESPACE_STD @@ -134,4 +137,6 @@ #endif // _LIBCPP_STD_VER >= 23 +_LIBCPP_POP_MACROS + #endif // _LIBCPP___RANGES_AS_RVALUE_H Index: libcxx/include/__ranges/common_view.h =================================================================== --- libcxx/include/__ranges/common_view.h +++ libcxx/include/__ranges/common_view.h @@ -29,6 +29,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 20 @@ -133,4 +136,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___RANGES_COMMON_VIEW_H Index: libcxx/include/__ranges/owning_view.h =================================================================== --- libcxx/include/__ranges/owning_view.h +++ libcxx/include/__ranges/owning_view.h @@ -27,6 +27,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 20 @@ -80,4 +83,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___RANGES_OWNING_VIEW_H Index: libcxx/include/__ranges/range_adaptor.h =================================================================== --- libcxx/include/__ranges/range_adaptor.h +++ libcxx/include/__ranges/range_adaptor.h @@ -28,6 +28,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 20 @@ -76,4 +79,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___RANGES_RANGE_ADAPTOR_H Index: libcxx/include/__ranges/subrange.h =================================================================== --- libcxx/include/__ranges/subrange.h +++ libcxx/include/__ranges/subrange.h @@ -46,6 +46,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 20 @@ -288,4 +291,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___RANGES_SUBRANGE_H Index: libcxx/include/__stop_token/intrusive_shared_ptr.h =================================================================== --- libcxx/include/__stop_token/intrusive_shared_ptr.h +++ libcxx/include/__stop_token/intrusive_shared_ptr.h @@ -21,6 +21,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 20 @@ -125,4 +128,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___STOP_TOKEN_INTRUSIVE_SHARED_PTR_H Index: libcxx/include/__undef_macros =================================================================== --- libcxx/include/__undef_macros +++ libcxx/include/__undef_macros @@ -14,3 +14,15 @@ #ifdef max # undef max #endif + +#ifdef refresh +# undef refresh +#endif + +#ifdef move +# undef move +#endif + +#ifdef erase +# undef erase +#endif Index: libcxx/include/__utility/exception_guard.h =================================================================== --- libcxx/include/__utility/exception_guard.h +++ libcxx/include/__utility/exception_guard.h @@ -19,6 +19,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD // __exception_guard is a helper class for writing code with the strong exception guarantee. @@ -136,4 +139,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___UTILITY_TRANSACTION_H Index: libcxx/include/__utility/exchange.h =================================================================== --- libcxx/include/__utility/exchange.h +++ libcxx/include/__utility/exchange.h @@ -19,6 +19,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 14 @@ -35,4 +38,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___UTILITY_EXCHANGE_H Index: libcxx/include/__utility/move.h =================================================================== --- libcxx/include/__utility/move.h +++ libcxx/include/__utility/move.h @@ -20,6 +20,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -41,4 +44,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___UTILITY_MOVE_H Index: libcxx/include/__utility/pair.h =================================================================== --- libcxx/include/__utility/pair.h +++ libcxx/include/__utility/pair.h @@ -55,6 +55,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD template @@ -893,4 +896,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___UTILITY_PAIR_H Index: libcxx/include/__utility/swap.h =================================================================== --- libcxx/include/__utility/swap.h +++ libcxx/include/__utility/swap.h @@ -23,6 +23,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #ifndef _LIBCPP_CXX03_LANG @@ -51,4 +54,6 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP___UTILITY_SWAP_H Index: libcxx/include/any =================================================================== --- libcxx/include/any +++ libcxx/include/any @@ -123,6 +123,9 @@ }; } // namespace std +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if _LIBCPP_STD_VER >= 17 @@ -710,6 +713,8 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17 # include #endif Index: libcxx/include/experimental/propagate_const =================================================================== --- libcxx/include/experimental/propagate_const +++ libcxx/include/experimental/propagate_const @@ -137,6 +137,9 @@ #if _LIBCPP_STD_VER >= 14 +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_LFTS_V2 template @@ -592,6 +595,8 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP_STD_VER >= 14 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 Index: libcxx/include/optional =================================================================== --- libcxx/include/optional +++ libcxx/include/optional @@ -255,6 +255,9 @@ #if _LIBCPP_STD_VER >= 17 +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_NORETURN @@ -1667,6 +1670,8 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #endif // _LIBCPP_STD_VER >= 17 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 Index: libcxx/include/scoped_allocator =================================================================== --- libcxx/include/scoped_allocator +++ libcxx/include/scoped_allocator @@ -130,6 +130,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #if !defined(_LIBCPP_CXX03_LANG) @@ -720,6 +723,8 @@ _LIBCPP_END_NAMESPACE_STD +_LIBCPP_POP_MACROS + #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 # include # include Index: libcxx/include/tuple =================================================================== --- libcxx/include/tuple +++ libcxx/include/tuple @@ -270,6 +270,9 @@ # pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD #ifndef _LIBCPP_CXX03_LANG @@ -1854,6 +1857,8 @@ #endif // !defined(_LIBCPP_CXX03_LANG) +_LIBCPP_POP_MACROS + _LIBCPP_END_NAMESPACE_STD #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 Index: libcxx/include/utility =================================================================== --- libcxx/include/utility +++ libcxx/include/utility @@ -246,6 +246,8 @@ */ +#include <__undef_macros> + #include <__assert> // all public C++ headers provide the assertion handler #include <__config> #include <__utility/as_const.h> Index: libcxx/test/libcxx/nasty_macros.gen.py =================================================================== --- libcxx/test/libcxx/nasty_macros.gen.py +++ libcxx/test/libcxx/nasty_macros.gen.py @@ -149,5 +149,10 @@ #define min NASTY_MACRO #define max NASTY_MACRO +// Test to make sure curses has no conflicting macros with the standard library +#define move NASTY_MACRO +#define erase NASTY_MACRO +#define refresh NASTY_MACRO + #include <{header}> """)