[clang][Interp][NFC] Return std::nullopt explicitly
authorTimm Bäder <tbaeder@redhat.com>
Mon, 19 Jun 2023 07:15:04 +0000 (09:15 +0200)
committerTimm Bäder <tbaeder@redhat.com>
Tue, 4 Jul 2023 14:16:18 +0000 (16:16 +0200)
clang/lib/AST/Interp/Program.cpp

index f6f378d..a974902 100644 (file)
@@ -120,7 +120,7 @@ std::optional<unsigned> 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<unsigned> Program::getOrCreateGlobal(const ValueDecl *VD,
     GlobalIndices[VD] = *Idx;
     return Idx;
   }
-  return {};
+  return std::nullopt;
 }
 
 std::optional<unsigned> Program::getOrCreateDummy(const ParmVarDecl *PD) {
@@ -154,7 +154,7 @@ std::optional<unsigned> Program::getOrCreateDummy(const ParmVarDecl *PD) {
     DummyParams[PD] = *Idx;
     return Idx;
   }
-  return {};
+  return std::nullopt;
 }
 
 std::optional<unsigned> Program::createGlobal(const ValueDecl *VD,
@@ -173,7 +173,7 @@ std::optional<unsigned> Program::createGlobal(const ValueDecl *VD,
       GlobalIndices[P] = *Idx;
     return *Idx;
   }
-  return {};
+  return std::nullopt;
 }
 
 std::optional<unsigned> Program::createGlobal(const Expr *E) {
@@ -194,7 +194,7 @@ std::optional<unsigned> Program::createGlobal(const DeclTy &D, QualType Ty,
                             IsTemporary);
   }
   if (!Desc)
-    return {};
+    return std::nullopt;
 
   // Allocate a block for storage.
   unsigned I = Globals.size();