summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/ADT/StringSwitch.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/llvm/include/llvm/ADT/StringSwitch.h b/llvm/include/llvm/ADT/StringSwitch.h
index 5fad2476181..9e073030d04 100644
--- a/llvm/include/llvm/ADT/StringSwitch.h
+++ b/llvm/include/llvm/ADT/StringSwitch.h
@@ -55,16 +55,13 @@ public:
// 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) {
- *this = std::move(other);
- }
- StringSwitch &operator=(StringSwitch &&other) {
- Str = std::move(other.Str);
- Result = std::move(other.Result);
- return *this;
- }
+ StringSwitch(StringSwitch &&other)
+ : Str(other.Str), Result(std::move(other.Result)) { }
~StringSwitch() = default;
OpenPOWER on IntegriCloud