[llvm] r276685 - Fix r276671 to not use a defaulted move constructor.
Jordan Rose via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 25 13:34:25 PDT 2016
Author: jrose
Date: Mon Jul 25 15:34:25 2016
New Revision: 276685
URL: http://llvm.org/viewvc/llvm-project?rev=276685&view=rev
Log:
Fix r276671 to not use a defaulted move constructor.
MSVC won't provide the body of this move constructor and assignment
operator, possibly because the copy constructor is banned. Just write
it manually.
Modified:
llvm/trunk/include/llvm/ADT/StringSwitch.h
Modified: llvm/trunk/include/llvm/ADT/StringSwitch.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringSwitch.h?rev=276685&r1=276684&r2=276685&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/StringSwitch.h (original)
+++ llvm/trunk/include/llvm/ADT/StringSwitch.h Mon Jul 25 15:34:25 2016
@@ -55,9 +55,17 @@ public:
// StringSwitch is not copyable.
StringSwitch(const StringSwitch &) = delete;
- StringSwitch(StringSwitch &&) = default;
void operator=(const StringSwitch &) = delete;
- StringSwitch &operator=(StringSwitch &&) = default;
+
+ StringSwitch(StringSwitch &&other) {
+ *this = std::move(other);
+ }
+ StringSwitch &operator=(StringSwitch &&other) {
+ Str = other.Str;
+ Result = other.Result;
+ return *this;
+ }
+
~StringSwitch() = default;
template<unsigned N>
More information about the llvm-commits
mailing list