[Support] Use std::optional in raw_ostream.h (NFC)
authorKazu Hirata <kazu@google.com>
Sun, 27 Nov 2022 22:16:12 +0000 (14:16 -0800)
committerKazu Hirata <kazu@google.com>
Sun, 27 Nov 2022 22:16:13 +0000 (14:16 -0800)
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

llvm/include/llvm/Support/raw_ostream.h

index bdb737d..9fb5f78 100644 (file)
@@ -21,6 +21,7 @@
 #include <cstddef>
 #include <cstdint>
 #include <cstring>
+#include <optional>
 #include <string>
 #include <string_view>
 #include <system_error>
@@ -442,7 +443,7 @@ class raw_fd_ostream : public raw_pwrite_stream {
   bool ShouldClose;
   bool SupportsSeeking = false;
   bool IsRegularFile = false;
-  mutable Optional<bool> HasColors;
+  mutable std::optional<bool> HasColors;
 
 #ifdef _WIN32
   /// True if this fd refers to a Windows console device. Mintty and other