From 87729bcbb817123b50eb12f168d359c4607af16d Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Thu, 26 Jun 2025 08:40:55 -0700 Subject: [PATCH] [clangd] Migrate away from std::nullopt (NFC) (#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 {}. --- clang-tools-extra/clangd/AST.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang-tools-extra/clangd/AST.cpp b/clang-tools-extra/clangd/AST.cpp index 3b991e5e9013..e27423652781 100644 --- a/clang-tools-extra/clangd/AST.cpp +++ b/clang-tools-extra/clangd/AST.cpp @@ -440,7 +440,7 @@ QualType declaredType(const TypeDecl *D) { if (const auto *Args = CTSD->getTemplateArgsAsWritten()) return Context.getTemplateSpecializationType( TemplateName(CTSD->getSpecializedTemplate()), Args->arguments(), - /*CanonicalArgs=*/std::nullopt); + /*CanonicalArgs=*/{}); return Context.getTypeDeclType(D); }