1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

Make StringSaver::save less ambiguous.

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.

llvm-svn: 301512
This commit is contained in:
Rui Ueyama 2017-04-27 03:45:33 +00:00
parent 0447f26de6
commit 566703b56d

View File

@ -26,7 +26,7 @@ public:
StringRef save(const char *S) { return save(StringRef(S)); } StringRef save(const char *S) { return save(StringRef(S)); }
StringRef save(StringRef S); StringRef save(StringRef S);
StringRef save(const Twine &S) { return save(StringRef(S.str())); } 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 #endif