diff --git a/clang/lib/AST/Interp/Program.cpp b/clang/lib/AST/Interp/Program.cpp index f6f378dd49f167..a9749022ee677b 100644 --- a/clang/lib/AST/Interp/Program.cpp +++ b/clang/lib/AST/Interp/Program.cpp @@ -120,7 +120,7 @@ std::optional Program::getGlobal(const ValueDecl *VD) { // Map the decl to the existing index. if (Index) { GlobalIndices[VD] = *Index; - return {}; + return std::nullopt; } return Index; @@ -135,7 +135,7 @@ std::optional Program::getOrCreateGlobal(const ValueDecl *VD, GlobalIndices[VD] = *Idx; return Idx; } - return {}; + return std::nullopt; } std::optional Program::getOrCreateDummy(const ParmVarDecl *PD) { @@ -154,7 +154,7 @@ std::optional Program::getOrCreateDummy(const ParmVarDecl *PD) { DummyParams[PD] = *Idx; return Idx; } - return {}; + return std::nullopt; } std::optional Program::createGlobal(const ValueDecl *VD, @@ -173,7 +173,7 @@ std::optional Program::createGlobal(const ValueDecl *VD, GlobalIndices[P] = *Idx; return *Idx; } - return {}; + return std::nullopt; } std::optional Program::createGlobal(const Expr *E) { @@ -194,7 +194,7 @@ std::optional Program::createGlobal(const DeclTy &D, QualType Ty, IsTemporary); } if (!Desc) - return {}; + return std::nullopt; // Allocate a block for storage. unsigned I = Globals.size();