[libcxx-commits] [libcxx] [libc++] P0792R14: `std::function_ref` (PR #94894)

via libcxx-commits libcxx-commits at lists.llvm.org
Sun Mar 8 03:54:45 PDT 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 ,h,cpp,inc -- libcxx/include/__functional/function_ref.h libcxx/include/__functional/function_ref_common.h libcxx/include/__functional/function_ref_impl.h libcxx/include/__utility/constant_arg.h libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.ref/ctor/ctad.pass.cpp libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.ref/invoke/const.pass.cpp libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.ref/invoke/const_noexcept.pass.cpp libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.ref/invoke/default.pass.cpp libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.ref/invoke/noexcept.pass.cpp libcxx/include/__configuration/experimental.h libcxx/include/functional libcxx/include/utility libcxx/include/version libcxx/modules/std/functional.inc libcxx/modules/std/utility.inc libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.compile.pass.cpp libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.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/__functional/function_ref.h b/libcxx/include/__functional/function_ref.h
index fbfb0d8a8..a67985fe8 100644
--- a/libcxx/include/__functional/function_ref.h
+++ b/libcxx/include/__functional/function_ref.h
@@ -19,29 +19,29 @@
 #if _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPERIMENTAL_FUNCTION_REF
 // NOLINTBEGIN(readability-duplicate-include)
 
-#define _LIBCPP_FUNCTION_REF_CV
-#define _LIBCPP_FUNCTION_REF_NOEXCEPT false
-#include <__functional/function_ref_impl.h>
-#undef _LIBCPP_FUNCTION_REF_CV
-#undef _LIBCPP_FUNCTION_REF_NOEXCEPT
-
-#define _LIBCPP_FUNCTION_REF_CV
-#define _LIBCPP_FUNCTION_REF_NOEXCEPT true
-#include <__functional/function_ref_impl.h>
-#undef _LIBCPP_FUNCTION_REF_CV
-#undef _LIBCPP_FUNCTION_REF_NOEXCEPT
-
-#define _LIBCPP_FUNCTION_REF_CV const
-#define _LIBCPP_FUNCTION_REF_NOEXCEPT false
-#include <__functional/function_ref_impl.h>
-#undef _LIBCPP_FUNCTION_REF_CV
-#undef _LIBCPP_FUNCTION_REF_NOEXCEPT
-
-#define _LIBCPP_FUNCTION_REF_CV const
-#define _LIBCPP_FUNCTION_REF_NOEXCEPT true
-#include <__functional/function_ref_impl.h>
-#undef _LIBCPP_FUNCTION_REF_CV
-#undef _LIBCPP_FUNCTION_REF_NOEXCEPT
+#  define _LIBCPP_FUNCTION_REF_CV
+#  define _LIBCPP_FUNCTION_REF_NOEXCEPT false
+#  include <__functional/function_ref_impl.h>
+#  undef _LIBCPP_FUNCTION_REF_CV
+#  undef _LIBCPP_FUNCTION_REF_NOEXCEPT
+
+#  define _LIBCPP_FUNCTION_REF_CV
+#  define _LIBCPP_FUNCTION_REF_NOEXCEPT true
+#  include <__functional/function_ref_impl.h>
+#  undef _LIBCPP_FUNCTION_REF_CV
+#  undef _LIBCPP_FUNCTION_REF_NOEXCEPT
+
+#  define _LIBCPP_FUNCTION_REF_CV const
+#  define _LIBCPP_FUNCTION_REF_NOEXCEPT false
+#  include <__functional/function_ref_impl.h>
+#  undef _LIBCPP_FUNCTION_REF_CV
+#  undef _LIBCPP_FUNCTION_REF_NOEXCEPT
+
+#  define _LIBCPP_FUNCTION_REF_CV const
+#  define _LIBCPP_FUNCTION_REF_NOEXCEPT true
+#  include <__functional/function_ref_impl.h>
+#  undef _LIBCPP_FUNCTION_REF_CV
+#  undef _LIBCPP_FUNCTION_REF_NOEXCEPT
 
 // NOLINTEND(readability-duplicate-include)
 #endif // _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPERIMENTAL_FUNCTION_REF

``````````

</details>


https://github.com/llvm/llvm-project/pull/94894


More information about the libcxx-commits mailing list