From 7b31c57d69833a1f44d544f42de6f73e2a67f174 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 14 Jan 2023 15:26:28 -0800 Subject: [gtest] Use std::optional instead of llvm::Optional (NFC) This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716 --- .../googletest/include/gtest/internal/custom/raw-ostream.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'third-party') diff --git a/third-party/unittest/googletest/include/gtest/internal/custom/raw-ostream.h b/third-party/unittest/googletest/include/gtest/internal/custom/raw-ostream.h index cff78f5c33f6..76dcdee41f2f 100644 --- a/third-party/unittest/googletest/include/gtest/internal/custom/raw-ostream.h +++ b/third-party/unittest/googletest/include/gtest/internal/custom/raw-ostream.h @@ -40,9 +40,9 @@ template decltype(auto) printable(const T &V) { // If raw_ostream support is enabled, we specialize for types with operator<< // that takes a raw_ostream. #if !GTEST_NO_LLVM_SUPPORT -#include "llvm/ADT/Optional.h" #include "llvm/Support/raw_os_ostream.h" #include "llvm/Support/raw_ostream.h" +#include #include namespace llvm_gtest { @@ -68,14 +68,14 @@ struct StreamSwitch() static const RawStreamProxy printable(const T &V) { return {V}; } }; -// llvm::Optional has a template operator<<, which means it will not accept any +// std::optional has a template operator<<, which means it will not accept any // implicit conversions, so we need to special-case it here. template -struct StreamSwitch, +struct StreamSwitch, decltype((void)(std::declval() - << std::declval>()))> { - static const RawStreamProxy> - printable(const llvm::Optional &V) { + << std::declval>()))> { + static const RawStreamProxy> + printable(const std::optional &V) { return {V}; } }; -- cgit v1.2.1