Skip to content

Commit

Permalink
Make StringSaver::save less ambiguous.
Browse files Browse the repository at this point in the history
Previously, an expression such as Saver.save(std::string("foo") + "bar")
didn't compile because there is an ambiguity as to whether the argument
is of const Twine& or StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301512 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
rui314 committed Apr 27, 2017
1 parent 51ff1d7 commit 53d587e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/llvm/Support/StringSaver.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class StringSaver final {
StringRef save(const char *S) { return save(StringRef(S)); }
StringRef save(StringRef S);
StringRef save(const Twine &S) { return save(StringRef(S.str())); }
StringRef save(std::string &S) { return save(StringRef(S)); }
StringRef save(const std::string &S) { return save(StringRef(S)); }
};
}
#endif

0 comments on commit 53d587e

Please sign in to comment.