[llvm] r301512 - Make StringSaver::save less ambiguous.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 26 20:45:34 PDT 2017
Author: ruiu
Date: Wed Apr 26 22:45:33 2017
New Revision: 301512
URL: http://llvm.org/viewvc/llvm-project?rev=301512&view=rev
Log:
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.
Modified:
llvm/trunk/include/llvm/Support/StringSaver.h
Modified: llvm/trunk/include/llvm/Support/StringSaver.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/StringSaver.h?rev=301512&r1=301511&r2=301512&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/StringSaver.h (original)
+++ llvm/trunk/include/llvm/Support/StringSaver.h Wed Apr 26 22:45:33 2017
@@ -26,7 +26,7 @@ public:
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
More information about the llvm-commits
mailing list