[PATCH] D102390: Fix Google Test compilation failure when standard library implements LWG 2221
Evgeny Mandrikov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 13 01:34:17 PDT 2021
Godin created this revision.
Godin requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Without this patch when using CMAKE_CXX_STANDARD=17
and MSVC 19.28.29914.0 compilation of unit tests
(for example clang\unittests\Basic\SourceManagerTest.cpp)
fails with
llvm\utils\unittest\googletest\include\gtest\gtest-printers.h(250): error C2593: 'operator <<' is ambiguous
Patch is taken from Google Test:
https://github.com/google/googletest/commit/f66ab00704cd47e4e63ef6d425ca14b9192aaebb
Add printer for std::nullptr_t, addressing https://github.com/google/googletest/issues/1616
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D102390
Files:
llvm/utils/unittest/googletest/include/gtest/gtest-printers.h
Index: llvm/utils/unittest/googletest/include/gtest/gtest-printers.h
===================================================================
--- llvm/utils/unittest/googletest/include/gtest/gtest-printers.h
+++ llvm/utils/unittest/googletest/include/gtest/gtest-printers.h
@@ -582,6 +582,10 @@
}
#endif // GTEST_HAS_STD_WSTRING
+#if GTEST_LANG_CXX11
+inline void PrintTo(std::nullptr_t, ::std::ostream* os) { *os << "(nullptr)"; }
+#endif // GTEST_LANG_CXX11
+
#if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
// Helper function for printing a tuple. T must be instantiated with
// a tuple type.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102390.345069.patch
Type: text/x-patch
Size: 601 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210513/5693013a/attachment.bin>
More information about the llvm-commits
mailing list