Skip to content

Commit

Permalink
Fix r276671 to not use a defaulted move constructor.
Browse files Browse the repository at this point in the history
MSVC won't provide the body of this move constructor and assignment
operator, possibly because the copy constructor is banned. Just write
it manually.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276685 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
jrose-apple committed Jul 25, 2016
1 parent 4a44da0 commit cb3d8af
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions include/llvm/ADT/StringSwitch.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,17 @@ class StringSwitch {

// 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>
Expand Down

0 comments on commit cb3d8af

Please sign in to comment.