[llvm] [NFC][ADT] Introduce a test harness for StringRefTest (PR #105500)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 21 04:58:58 PDT 2024


================
@@ -16,20 +16,7 @@
 #include "gtest/gtest.h"
 using namespace llvm;
 
-namespace llvm {
-
-std::ostream &operator<<(std::ostream &OS, const StringRef &S) {
----------------
s-barannikov wrote:

Thanks for checking. This is probably because there is another printer [here](https://github.com/llvm/llvm-project/blob/a866ce789eb99da4d7a486eeb60a53be6c75f4fd/third-party/unittest/googletest/include/gtest/internal/custom/gtest-printers.h#L52) and it takes precedence.

I wasn't aware of this header until now. I think the overloaded << for StringRef can safely be removed then.
(and I guess `pair<StringRef, StringRef>` overload is still needed)


https://github.com/llvm/llvm-project/pull/105500


More information about the llvm-commits mailing list