diff options
| author | David Zarzycki <dave@znu.io> | 2018-03-29 16:51:28 +0000 |
|---|---|---|
| committer | David Zarzycki <dave@znu.io> | 2018-03-29 16:51:28 +0000 |
| commit | b458329327978b40f2f166a5a637fd4ef12c3883 (patch) | |
| tree | 344eec13e6730952f67f808ee8cae8713cc40aa0 | |
| parent | db0f2f68b0651bd206aa36976b0760efb1410597 (diff) | |
| download | bcm5719-llvm-b458329327978b40f2f166a5a637fd4ef12c3883.tar.gz bcm5719-llvm-b458329327978b40f2f166a5a637fd4ef12c3883.zip | |
[ADT] NFC: Fix bogus StringSwitch rule-of-five boilerplate
Now that 'Str' is constant, the rule-of-file logic needs updating.
Reported by: vit9696@avp.su
Reviewed by: jordan_rose@apple.com
llvm-svn: 328803
| -rw-r--r-- | llvm/include/llvm/ADT/StringSwitch.h | 13 |
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; |

