Skip to content

Commit 87729bc

Browse files
[clangd] Migrate away from std::nullopt (NFC) (llvm#145841)
ArrayRef has a constructor that accepts std::nullopt. This constructor dates back to the days when we still had llvm::Optional. Since the use of std::nullopt outside the context of std::optional is kind of abuse and not intuitive to new comers, I would like to move away from the constructor and eventually remove it. This patch replaces std::nullopt with {}.
1 parent a13cf84 commit 87729bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang-tools-extra/clangd/AST.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ QualType declaredType(const TypeDecl *D) {
440440
if (const auto *Args = CTSD->getTemplateArgsAsWritten())
441441
return Context.getTemplateSpecializationType(
442442
TemplateName(CTSD->getSpecializedTemplate()), Args->arguments(),
443-
/*CanonicalArgs=*/std::nullopt);
443+
/*CanonicalArgs=*/{});
444444
return Context.getTypeDeclType(D);
445445
}
446446

0 commit comments

Comments
 (0)