[libcxx-commits] [libcxx] 6afd6e9 - [libc++] Workaround failures with modules on Clang ToT
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Jul 8 08:51:18 PDT 2021
Author: Louis Dionne
Date: 2021-07-08T11:50:54-04:00
New Revision: 6afd6e96ce203ca6b2840df48e939434237bf82e
URL: https://github.com/llvm/llvm-project/commit/6afd6e96ce203ca6b2840df48e939434237bf82e
DIFF: https://github.com/llvm/llvm-project/commit/6afd6e96ce203ca6b2840df48e939434237bf82e.diff
LOG: [libc++] Workaround failures with modules on Clang ToT
Added:
Modified:
libcxx/include/__iterator/advance.h
libcxx/include/__iterator/next.h
libcxx/include/__iterator/prev.h
libcxx/test/support/test_standard_function.h
Removed:
################################################################################
diff --git a/libcxx/include/__iterator/advance.h b/libcxx/include/__iterator/advance.h
index 4971bebfed864..a903e45cec51d 100644
--- a/libcxx/include/__iterator/advance.h
+++ b/libcxx/include/__iterator/advance.h
@@ -178,6 +178,9 @@ struct __advance_fn final : __function_like {
_LIBCPP_UNREACHABLE();
}
+
+ // TODO: Remove this workaround for broken Clang modules.
+ using __function_like::operator&;
};
inline constexpr auto advance = __advance_fn(__function_like::__tag());
diff --git a/libcxx/include/__iterator/next.h b/libcxx/include/__iterator/next.h
index af719e3cab113..5db5b2fd5875e 100644
--- a/libcxx/include/__iterator/next.h
+++ b/libcxx/include/__iterator/next.h
@@ -68,6 +68,9 @@ struct __next_fn final : private __function_like {
ranges::advance(__x, __n, __bound);
return __x;
}
+
+ // TODO: Remove this workaround for broken Clang modules.
+ using __function_like::operator&;
};
inline constexpr auto next = __next_fn(__function_like::__tag());
diff --git a/libcxx/include/__iterator/prev.h b/libcxx/include/__iterator/prev.h
index f1ba2be5ff950..1fc2b9c73f1a2 100644
--- a/libcxx/include/__iterator/prev.h
+++ b/libcxx/include/__iterator/prev.h
@@ -61,6 +61,9 @@ struct __prev_fn final : private __function_like {
ranges::advance(__x, -__n, __bound);
return __x;
}
+
+ // TODO: Remove this workaround for broken Clang modules.
+ using __function_like::operator&;
};
inline constexpr auto prev = __prev_fn(__function_like::__tag());
diff --git a/libcxx/test/support/test_standard_function.h b/libcxx/test/support/test_standard_function.h
index f24d2acb81db0..1e207cfdac00b 100644
--- a/libcxx/test/support/test_standard_function.h
+++ b/libcxx/test/support/test_standard_function.h
@@ -17,7 +17,7 @@ constexpr bool is_addressable = requires(T t) {
};
template <class T>
-[[nodiscard]] constexpr bool is_function_like() {
+constexpr bool is_function_like() {
using X = std::remove_cvref_t<T>;
static_assert(!is_addressable<X>);
static_assert(!is_addressable<X const>);
More information about the libcxx-commits
mailing list