|
| 1 | +diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake |
| 2 | +index 624a3c7..8d0493d 100644 |
| 3 | +--- a/CMake/AbseilHelpers.cmake |
| 4 | ++++ b/CMake/AbseilHelpers.cmake |
| 5 | +@@ -345,7 +345,7 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n") |
| 6 | + endif() |
| 7 | + endif() |
| 8 | + |
| 9 | +- if(ABSL_ENABLE_INSTALL) |
| 10 | ++ if(ABSL_ENABLE_INSTALL AND NOT ABSL_CC_LIB_TESTONLY) |
| 11 | + install(TARGETS ${_NAME} EXPORT ${PROJECT_NAME}Targets |
| 12 | + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} |
| 13 | + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} |
| 14 | +diff --git a/CMakeLists.txt b/CMakeLists.txt |
| 15 | +index 1e7c856..a3c3dae 100644 |
| 16 | +--- a/CMakeLists.txt |
| 17 | ++++ b/CMakeLists.txt |
| 18 | +@@ -145,7 +145,7 @@ if((BUILD_TESTING AND ABSL_BUILD_TESTING) OR ABSL_BUILD_TEST_HELPERS) |
| 19 | + add_library(GTest::gmock ALIAS gmock) |
| 20 | + add_library(GTest::gmock_main ALIAS gmock_main) |
| 21 | + else() |
| 22 | +- message(FATAL_ERROR "ABSL_USE_EXTERNAL_GOOGLETEST is ON and ABSL_FIND_GOOGLETEST is OFF, which means that the top-level project must build the Google Test project. However, the target gtest was not found.") |
| 23 | ++ message(WARNING "ABSL_USE_EXTERNAL_GOOGLETEST is ON and ABSL_FIND_GOOGLETEST is OFF, which means that the top-level project must build the Google Test project. However, the target gtest was not found.") |
| 24 | + endif() |
| 25 | + endif() |
| 26 | + else() |
| 27 | +diff --git a/absl/flags/declare.h b/absl/flags/declare.h |
| 28 | +index 8d2a856..a154046 100644 |
| 29 | +--- a/absl/flags/declare.h |
| 30 | ++++ b/absl/flags/declare.h |
| 31 | +@@ -59,10 +59,15 @@ ABSL_NAMESPACE_END |
| 32 | + |
| 33 | + // Internal implementation of ABSL_DECLARE_FLAG to allow macro expansion of its |
| 34 | + // arguments. Clients must use ABSL_DECLARE_FLAG instead. |
| 35 | ++#if defined(_MSC_VER) |
| 36 | ++#define ABSL_DECLARE_FLAG_INTERNAL(type, name) \ |
| 37 | ++ extern absl::Flag<type> FLAGS_##name |
| 38 | ++#else |
| 39 | + #define ABSL_DECLARE_FLAG_INTERNAL(type, name) \ |
| 40 | + extern absl::Flag<type> FLAGS_##name; \ |
| 41 | + namespace absl /* block flags in namespaces */ {} \ |
| 42 | + /* second redeclaration is to allow applying attributes */ \ |
| 43 | + extern absl::Flag<type> FLAGS_##name |
| 44 | ++#endif // _MSC_VER |
| 45 | + |
| 46 | + #endif // ABSL_FLAGS_DECLARE_H_ |
| 47 | +diff --git a/absl/log/CMakeLists.txt b/absl/log/CMakeLists.txt |
| 48 | +index eb19bec..13b2d24 100644 |
| 49 | +--- a/absl/log/CMakeLists.txt |
| 50 | ++++ b/absl/log/CMakeLists.txt |
| 51 | +@@ -47,6 +47,7 @@ absl_cc_library( |
| 52 | + absl::base |
| 53 | + absl::config |
| 54 | + absl::core_headers |
| 55 | ++ absl::has_ostream_operator |
| 56 | + absl::leak_check |
| 57 | + absl::log_internal_nullguard |
| 58 | + absl::log_internal_nullstream |
| 59 | +diff --git a/absl/log/check_test_impl.inc b/absl/log/check_test_impl.inc |
| 60 | +index 5a7caf4..7bcedd4 100644 |
| 61 | +--- a/absl/log/check_test_impl.inc |
| 62 | ++++ b/absl/log/check_test_impl.inc |
| 63 | +@@ -13,6 +13,8 @@ |
| 64 | + // See the License for the specific language governing permissions and |
| 65 | + // limitations under the License. |
| 66 | + |
| 67 | ++// SKIP_ABSL_INLINE_NAMESPACE_CHECK |
| 68 | ++ |
| 69 | + #ifndef ABSL_LOG_CHECK_TEST_IMPL_H_ |
| 70 | + #define ABSL_LOG_CHECK_TEST_IMPL_H_ |
| 71 | + |
| 72 | +@@ -241,6 +243,18 @@ TEST(CHECKTest, TestBinaryChecksWithPrimitives) { |
| 73 | + ABSL_TEST_CHECK_LT(1, 2); |
| 74 | + } |
| 75 | + |
| 76 | ++TEST(CHECKTest, TestBinaryChecksWithStringComparison) { |
| 77 | ++ const std::string a = "a"; |
| 78 | ++ ABSL_TEST_CHECK_EQ(a, "a"); |
| 79 | ++ ABSL_TEST_CHECK_NE(a, "b"); |
| 80 | ++ ABSL_TEST_CHECK_GE(a, a); |
| 81 | ++ ABSL_TEST_CHECK_GE("b", a); |
| 82 | ++ ABSL_TEST_CHECK_LE(a, "a"); |
| 83 | ++ ABSL_TEST_CHECK_LE(a, "b"); |
| 84 | ++ ABSL_TEST_CHECK_GT("b", a); |
| 85 | ++ ABSL_TEST_CHECK_LT(a, "b"); |
| 86 | ++} |
| 87 | ++ |
| 88 | + // For testing using CHECK*() on anonymous enums. |
| 89 | + enum { CASE_A, CASE_B }; |
| 90 | + |
| 91 | +diff --git a/absl/log/internal/BUILD.bazel b/absl/log/internal/BUILD.bazel |
| 92 | +index 1ba9d76..005861f 100644 |
| 93 | +--- a/absl/log/internal/BUILD.bazel |
| 94 | ++++ b/absl/log/internal/BUILD.bazel |
| 95 | +@@ -82,6 +82,7 @@ cc_library( |
| 96 | + "//absl/base:nullability", |
| 97 | + "//absl/debugging:leak_check", |
| 98 | + "//absl/strings", |
| 99 | ++ "//absl/strings:has_ostream_operator", |
| 100 | + ], |
| 101 | + ) |
| 102 | + |
| 103 | +diff --git a/absl/log/internal/check_op.h b/absl/log/internal/check_op.h |
| 104 | +index 4554475..c607864 100644 |
| 105 | +--- a/absl/log/internal/check_op.h |
| 106 | ++++ b/absl/log/internal/check_op.h |
| 107 | +@@ -40,6 +40,7 @@ |
| 108 | + #include "absl/log/internal/nullstream.h" |
| 109 | + #include "absl/log/internal/strip.h" |
| 110 | + #include "absl/strings/has_absl_stringify.h" |
| 111 | ++#include "absl/strings/has_ostream_operator.h" |
| 112 | + #include "absl/strings/string_view.h" |
| 113 | + |
| 114 | + // `ABSL_LOG_INTERNAL_STRIP_STRING_LITERAL` wraps string literals that |
| 115 | +@@ -357,21 +358,12 @@ std::enable_if_t<HasAbslStringify<T>::value, |
| 116 | + StringifyToStreamWrapper<T>> |
| 117 | + Detect(...); // Ellipsis has lowest preference when int passed. |
| 118 | + |
| 119 | +-// is_streamable is true for types that have an output stream operator<<. |
| 120 | +-template <class T, class = void> |
| 121 | +-struct is_streamable : std::false_type {}; |
| 122 | +- |
| 123 | +-template <class T> |
| 124 | +-struct is_streamable<T, std::void_t<decltype(std::declval<std::ostream&>() |
| 125 | +- << std::declval<T>())>> |
| 126 | +- : std::true_type {}; |
| 127 | +- |
| 128 | + // This overload triggers when T is neither possible to print nor an enum. |
| 129 | + template <typename T> |
| 130 | + std::enable_if_t<std::negation_v<std::disjunction< |
| 131 | + std::is_convertible<T, int>, std::is_enum<T>, |
| 132 | + std::is_pointer<T>, std::is_same<T, std::nullptr_t>, |
| 133 | +- is_streamable<T>, HasAbslStringify<T>>>, |
| 134 | ++ HasOstreamOperator<T>, HasAbslStringify<T>>>, |
| 135 | + UnprintableWrapper> |
| 136 | + Detect(...); |
| 137 | + |
| 138 | +@@ -382,9 +374,10 @@ Detect(...); |
| 139 | + // one backed by another integer is converted to (u)int64_t. |
| 140 | + template <typename T> |
| 141 | + std::enable_if_t< |
| 142 | +- std::conjunction_v< |
| 143 | +- std::is_enum<T>, std::negation<std::is_convertible<T, int>>, |
| 144 | +- std::negation<is_streamable<T>>, std::negation<HasAbslStringify<T>>>, |
| 145 | ++ std::conjunction_v<std::is_enum<T>, |
| 146 | ++ std::negation<std::is_convertible<T, int>>, |
| 147 | ++ std::negation<HasOstreamOperator<T>>, |
| 148 | ++ std::negation<HasAbslStringify<T>>>, |
| 149 | + std::conditional_t< |
| 150 | + std::is_same_v<std::underlying_type_t<T>, bool> || |
| 151 | + std::is_same_v<std::underlying_type_t<T>, char> || |
0 commit comments