[llvm] 4ff264d - [LLVM][ADT] Deprecate `make_scope_exit` in favour of CTAD (#174109)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 2 22:07:44 PST 2026
Author: Victor Chernyakin
Date: 2026-01-02T22:07:40-08:00
New Revision: 4ff264dd3523f4eb0d0f056f9950bc477a826e66
URL: https://github.com/llvm/llvm-project/commit/4ff264dd3523f4eb0d0f056f9950bc477a826e66
DIFF: https://github.com/llvm/llvm-project/commit/4ff264dd3523f4eb0d0f056f9950bc477a826e66.diff
LOG: [LLVM][ADT] Deprecate `make_scope_exit` in favour of CTAD (#174109)
Added:
Modified:
llvm/include/llvm/ADT/ScopeExit.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/ADT/ScopeExit.h b/llvm/include/llvm/ADT/ScopeExit.h
index 04b602a69f7e3..1c0d52eb58aca 100644
--- a/llvm/include/llvm/ADT/ScopeExit.h
+++ b/llvm/include/llvm/ADT/ScopeExit.h
@@ -15,6 +15,7 @@
#ifndef LLVM_ADT_SCOPEEXIT_H
#define LLVM_ADT_SCOPEEXIT_H
+#include "llvm/Support/Compiler.h"
#include <utility>
namespace llvm {
@@ -50,7 +51,11 @@ template <typename Callable> scope_exit(Callable) -> scope_exit<Callable>;
// returned object is kept).
//
// Interface is specified by p0052r2.
-template <typename Callable> [[nodiscard]] auto make_scope_exit(Callable &&F) {
+template <typename Callable>
+[[nodiscard]]
+LLVM_DEPRECATED("Prefer calling the constructor of llvm::scope_exit directly.",
+ "scope_exit") auto make_scope_exit(Callable &&F) {
+ // TODO(LLVM 24): Remove this function.
return scope_exit(std::forward<Callable>(F));
}
More information about the llvm-commits
mailing list