Skip to content

Conversation

@kazutakahirata
Copy link
Contributor

All others seem to use std::move in StringSwitch.

All others seem to use std::move in StringSwitch.
@llvmbot
Copy link
Member

llvmbot commented Nov 8, 2025

@llvm/pr-subscribers-llvm-adt

Author: Kazu Hirata (kazutakahirata)

Changes

All others seem to use std::move in StringSwitch.


Full diff: https://github.com/llvm/llvm-project/pull/167151.diff

1 Files Affected:

  • (modified) llvm/include/llvm/ADT/StringSwitch.h (+1-1)
diff --git a/llvm/include/llvm/ADT/StringSwitch.h b/llvm/include/llvm/ADT/StringSwitch.h
index 53ebec1eb3a54..5da6076c27390 100644
--- a/llvm/include/llvm/ADT/StringSwitch.h
+++ b/llvm/include/llvm/ADT/StringSwitch.h
@@ -158,7 +158,7 @@ class StringSwitch {
 
   StringSwitch &EndsWithLower(StringLiteral S, T Value) {
     if (!Result && Str.ends_with_insensitive(S))
-      Result = Value;
+      Result = std::move(Value);
 
     return *this;
   }

@kazutakahirata kazutakahirata merged commit 18b8e3b into llvm:main Nov 8, 2025
12 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20251108_ADT_StringSwitch_move branch November 8, 2025 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants