[llvm] Revert "[ADT] Deprecate the redirection from SmallSet to SmallPtrSet" (PR #155075)
Jordan Rupprecht via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 22 21:42:27 PDT 2025
https://github.com/rupprecht created https://github.com/llvm/llvm-project/pull/155075
Reverts llvm/llvm-project#154891
The added constructors changes the semantics of other implicitly defined constructors, which causes downstream breakages.
```
... error: object of type 'X' cannot be assigned because its copy assignment operator is implicitly deleted
... note: explicitly defaulted function was implicitly deleted here
... note: copy assignment operator of 'X' is implicitly deleted because field 'x' has a deleted copy assignment operator
llvm/include/llvm/ADT/SmallSet.h:283:3: note: copy assignment operator is implicitly deleted because 'SmallSet<const XX *, 2>' has a user-declared move constructor
283 | SmallSet(SmallSet &&) = default;
```
>From 53b3b78a49dcd954c53df0f1e029cdb1854f28ba Mon Sep 17 00:00:00 2001
From: Jordan Rupprecht <jordanrupprecht at gmail.com>
Date: Fri, 22 Aug 2025 23:33:07 -0500
Subject: [PATCH] Revert "[ADT] Deprecate the redirection from SmallSet to
SmallPtrSet (#154891)"
This reverts commit 01bbbb5b87e6ed67357478730adbe75c9762def8.
---
llvm/include/llvm/ADT/SmallSet.h | 23 +----------------------
1 file changed, 1 insertion(+), 22 deletions(-)
diff --git a/llvm/include/llvm/ADT/SmallSet.h b/llvm/include/llvm/ADT/SmallSet.h
index 802a257aaf6ad..eb434bcb71717 100644
--- a/llvm/include/llvm/ADT/SmallSet.h
+++ b/llvm/include/llvm/ADT/SmallSet.h
@@ -269,28 +269,7 @@ class SmallSet {
/// If this set is of pointer values, transparently switch over to using
/// SmallPtrSet for performance.
template <typename PointeeType, unsigned N>
-class SmallSet<PointeeType *, N> : public SmallPtrSet<PointeeType *, N> {
- using Base = SmallPtrSet<PointeeType *, N>;
-
-public:
- // LLVM_DEPRECATED placed between "template" and "class" above won't work for
- // some reason. Put a deprecation message on constructors instead.
- LLVM_DEPRECATED("Use SmallPtrSet instead", "SmallPtrSet")
- SmallSet() = default;
- LLVM_DEPRECATED("Use SmallPtrSet instead", "SmallPtrSet")
- SmallSet(const SmallSet &) = default;
- LLVM_DEPRECATED("Use SmallPtrSet instead", "SmallPtrSet")
- SmallSet(SmallSet &&) = default;
- template <typename IterT>
- LLVM_DEPRECATED("Use SmallPtrSet instead", "SmallPtrSet")
- SmallSet(IterT Begin, IterT End) : Base(Begin, End) {}
- template <typename Range>
- LLVM_DEPRECATED("Use SmallPtrSet instead", "SmallPtrSet")
- SmallSet(llvm::from_range_t, Range &&R)
- : Base(llvm::from_range, std::move(R)) {}
- LLVM_DEPRECATED("Use SmallPtrSet instead", "SmallPtrSet")
- SmallSet(std::initializer_list<PointeeType *> L) : Base(L) {}
-};
+class SmallSet<PointeeType*, N> : public SmallPtrSet<PointeeType*, N> {};
/// Equality comparison for SmallSet.
///
More information about the llvm-commits
mailing list