diff --git a/googletest/include/gtest/gtest-printers.h b/googletest/include/gtest/gtest-printers.h index 6b769ba758..846c264690 100644 --- a/googletest/include/gtest/gtest-printers.h +++ b/googletest/include/gtest/gtest-printers.h @@ -735,11 +735,11 @@ class UniversalPrinter> { public: static void Print(const Variant& value, ::std::ostream* os) { *os << '('; -#if __cplusplus >= 201703L - std::visit(Visitor{os, value.index()}, value); -#else +#if GTEST_HAS_ABSL absl::visit(Visitor{os, value.index()}, value); -#endif // __cplusplus >= 201703L +#else + std::visit(Visitor{os, value.index()}, value); +#endif // GTEST_HAS_ABSL *os << ')'; }