Skip to content

Commit 843ff75

Browse files
committed
[clang][Interp][NFC] Return std::nullopt explicitly
1 parent 044be8f commit 843ff75

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

clang/lib/AST/Interp/Program.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ std::optional<unsigned> Program::getGlobal(const ValueDecl *VD) {
120120
// Map the decl to the existing index.
121121
if (Index) {
122122
GlobalIndices[VD] = *Index;
123-
return {};
123+
return std::nullopt;
124124
}
125125

126126
return Index;
@@ -135,7 +135,7 @@ std::optional<unsigned> Program::getOrCreateGlobal(const ValueDecl *VD,
135135
GlobalIndices[VD] = *Idx;
136136
return Idx;
137137
}
138-
return {};
138+
return std::nullopt;
139139
}
140140

141141
std::optional<unsigned> Program::getOrCreateDummy(const ParmVarDecl *PD) {
@@ -154,7 +154,7 @@ std::optional<unsigned> Program::getOrCreateDummy(const ParmVarDecl *PD) {
154154
DummyParams[PD] = *Idx;
155155
return Idx;
156156
}
157-
return {};
157+
return std::nullopt;
158158
}
159159

160160
std::optional<unsigned> Program::createGlobal(const ValueDecl *VD,
@@ -173,7 +173,7 @@ std::optional<unsigned> Program::createGlobal(const ValueDecl *VD,
173173
GlobalIndices[P] = *Idx;
174174
return *Idx;
175175
}
176-
return {};
176+
return std::nullopt;
177177
}
178178

179179
std::optional<unsigned> Program::createGlobal(const Expr *E) {
@@ -194,7 +194,7 @@ std::optional<unsigned> Program::createGlobal(const DeclTy &D, QualType Ty,
194194
IsTemporary);
195195
}
196196
if (!Desc)
197-
return {};
197+
return std::nullopt;
198198

199199
// Allocate a block for storage.
200200
unsigned I = Globals.size();

0 commit comments

Comments
 (0)