[llvm] 932a7d6 - [ADT] Clean up StringSwitch class. NFC. (#163396)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 14 08:12:03 PDT 2025


Author: Jakub Kuderski
Date: 2025-10-14T15:11:59Z
New Revision: 932a7d685f1a683cdec903ecfe7ee28622a54b1e

URL: https://github.com/llvm/llvm-project/commit/932a7d685f1a683cdec903ecfe7ee28622a54b1e
DIFF: https://github.com/llvm/llvm-project/commit/932a7d685f1a683cdec903ecfe7ee28622a54b1e.diff

LOG: [ADT] Clean up StringSwitch class. NFC. (#163396)

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 a96535cd077fd..1bb07e39bcaa5 100644
--- a/llvm/include/llvm/ADT/StringSwitch.h
+++ b/llvm/include/llvm/ADT/StringSwitch.h
@@ -54,17 +54,14 @@ class StringSwitch {
   explicit StringSwitch(StringRef S)
   : Str(S), Result() { }
 
+  StringSwitch(StringSwitch &&) = default;
+
   // StringSwitch is not copyable.
   StringSwitch(const StringSwitch &) = delete;
 
   // StringSwitch is not assignable due to 'Str' being 'const'.
   void operator=(const StringSwitch &) = delete;
-  void operator=(StringSwitch &&other) = delete;
-
-  StringSwitch(StringSwitch &&other)
-    : Str(other.Str), Result(std::move(other.Result)) { }
-
-  ~StringSwitch() = default;
+  void operator=(StringSwitch &&) = delete;
 
   // Case-sensitive case matchers
   StringSwitch &Case(StringLiteral S, T Value) {


        


More information about the llvm-commits mailing list