diff --git a/clang/lib/Serialization/ASTWriterDecl.cpp b/clang/lib/Serialization/ASTWriterDecl.cpp index 2e390dbe79ec..7457c4920dd1 100644 --- a/clang/lib/Serialization/ASTWriterDecl.cpp +++ b/clang/lib/Serialization/ASTWriterDecl.cpp @@ -302,7 +302,7 @@ namespace clang { } MutableArrayRef getPartialSpecializations(FunctionTemplateDecl::Common *) { - return std::nullopt; + return {}; } template diff --git a/llvm/include/llvm/ADT/ArrayRef.h b/llvm/include/llvm/ADT/ArrayRef.h index 3b05cfb326c8..247975cc2fb1 100644 --- a/llvm/include/llvm/ADT/ArrayRef.h +++ b/llvm/include/llvm/ADT/ArrayRef.h @@ -304,7 +304,8 @@ namespace llvm { /*implicit*/ MutableArrayRef() = default; /// Construct an empty MutableArrayRef from std::nullopt. - /*implicit*/ MutableArrayRef(std::nullopt_t) : ArrayRef() {} + /*implicit*/ LLVM_DEPRECATED("Use {} or MutableArrayRef() instead", "{}") + MutableArrayRef(std::nullopt_t) : ArrayRef() {} /// Construct a MutableArrayRef from a single element. /*implicit*/ MutableArrayRef(T &OneElt) : ArrayRef(OneElt) {} diff --git a/mlir/lib/IR/Diagnostics.cpp b/mlir/lib/IR/Diagnostics.cpp index 3a0f81d24033..3e337951bcd3 100644 --- a/mlir/lib/IR/Diagnostics.cpp +++ b/mlir/lib/IR/Diagnostics.cpp @@ -727,7 +727,7 @@ SourceMgrDiagnosticVerifierHandlerImpl::computeExpectedDiags( raw_ostream &os, llvm::SourceMgr &mgr, const llvm::MemoryBuffer *buf) { // If the buffer is invalid, return an empty list. if (!buf) - return std::nullopt; + return {}; auto &expectedDiags = expectedDiagsPerFile[buf->getBufferIdentifier()]; // The number of the last line that did not correlate to a designator.