diff --git a/llvm/include/llvm/ADT/SmallSet.h b/llvm/include/llvm/ADT/SmallSet.h index eb434bcb71717..96a68fb8da0e2 100644 --- a/llvm/include/llvm/ADT/SmallSet.h +++ b/llvm/include/llvm/ADT/SmallSet.h @@ -268,8 +268,17 @@ class SmallSet { /// If this set is of pointer values, transparently switch over to using /// SmallPtrSet for performance. +/// +/// We use this middleman class DeprecatedSmallSet so that the deprecation +/// warning works. Placing LLVM_DEPRECATED just before SmallSet below won't +/// work. +template +class LLVM_DEPRECATED("Use SmallPtrSet instead", "SmallPtrSet") + DeprecatedSmallSet : public SmallPtrSet {}; + template -class SmallSet : public SmallPtrSet {}; +class SmallSet : public DeprecatedSmallSet { +}; /// Equality comparison for SmallSet. ///