[llvm] 2de905d - [ADT] Deprecate variadic `StringSwitch::Cases`. NFC. (#166066)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 2 08:00:11 PST 2025
Author: Jakub Kuderski
Date: 2025-11-02T11:00:07-05:00
New Revision: 2de905d17a73bdb9720236e6d7a88d31e6730eee
URL: https://github.com/llvm/llvm-project/commit/2de905d17a73bdb9720236e6d7a88d31e6730eee
DIFF: https://github.com/llvm/llvm-project/commit/2de905d17a73bdb9720236e6d7a88d31e6730eee.diff
LOG: [ADT] Deprecate variadic `StringSwitch::Cases`. NFC. (#166066)
Suggest the initializer_list overload instead.
For more context, see https://github.com/llvm/llvm-project/pull/163117.
Added:
Modified:
llvm/include/llvm/ADT/StringSwitch.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/ADT/StringSwitch.h b/llvm/include/llvm/ADT/StringSwitch.h
index 486815328ead7..8c8d31bd4f055 100644
--- a/llvm/include/llvm/ADT/StringSwitch.h
+++ b/llvm/include/llvm/ADT/StringSwitch.h
@@ -89,6 +89,7 @@ class StringSwitch {
return CasesImpl(CaseStrings, Value);
}
+ [[deprecated("Pass cases in std::initializer_list instead")]]
StringSwitch &Cases(StringLiteral S0, StringLiteral S1, T Value) {
return CasesImpl({S0, S1}, Value);
}
More information about the llvm-commits
mailing list