[libcxx-commits] [libcxx] 15213ed - [libc++] Fix negate and bit_xor in C++03 frozen headers (#187573)
via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Mar 26 11:47:19 PDT 2026
Author: Louis Dionne
Date: 2026-03-26T14:47:15-04:00
New Revision: 15213edadfcc01ae22d36ad5fe7a8f5dd414f82c
URL: https://github.com/llvm/llvm-project/commit/15213edadfcc01ae22d36ad5fe7a8f5dd414f82c
DIFF: https://github.com/llvm/llvm-project/commit/15213edadfcc01ae22d36ad5fe7a8f5dd414f82c.diff
LOG: [libc++] Fix negate and bit_xor in C++03 frozen headers (#187573)
An unintended change in #134045 gave them a default template argument,
which is supposed to be from C++14 onwards.
I considered adding a test for this but it is really awkward to test
that we don't support passing no template argument in C++03 mode and
that provides little value, so I decided against it.
Added:
Modified:
libcxx/include/__cxx03/__functional/operations.h
Removed:
################################################################################
diff --git a/libcxx/include/__cxx03/__functional/operations.h b/libcxx/include/__cxx03/__functional/operations.h
index 43bfbddc41cce..83840a2e5af27 100644
--- a/libcxx/include/__cxx03/__functional/operations.h
+++ b/libcxx/include/__cxx03/__functional/operations.h
@@ -67,7 +67,7 @@ struct _LIBCPP_TEMPLATE_VIS modulus : __binary_function<_Tp, _Tp, _Tp> {
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(modulus);
-template <class _Tp = void>
+template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS negate : __unary_function<_Tp, _Tp> {
typedef _Tp __result_type; // used by valarray
_LIBCPP_HIDE_FROM_ABI _Tp operator()(const _Tp& __x) const { return -__x; }
@@ -90,7 +90,7 @@ struct _LIBCPP_TEMPLATE_VIS bit_or : __binary_function<_Tp, _Tp, _Tp> {
};
_LIBCPP_CTAD_SUPPORTED_FOR_TYPE(bit_or);
-template <class _Tp = void>
+template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS bit_xor : __binary_function<_Tp, _Tp, _Tp> {
typedef _Tp __result_type; // used by valarray
_LIBCPP_HIDE_FROM_ABI _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x ^ __y; }
More information about the libcxx-commits
mailing list