diff options
author | Eike Ziller <eike.ziller@qt.io> | 2022-08-26 10:30:00 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2022-09-01 06:58:04 +0000 |
commit | 04e50438eb85c1b2be6d4dcdfd5319cdb55ae576 (patch) | |
tree | 4a3e9f078730bb538e2ca2751d189ff14a89901e /src/plugins/clangcodemodel/clangdswitchdecldef.cpp | |
parent | 34a9491a08639f8df0b55d74d51f4dadaa1cc2fd (diff) |
Utils: Remove Utils::optional
Since we are now requiring macOS 10.14 we can remove our local
implementation of optional and use std::optional for macOS too.
Change-Id: I2bd018261b68da64f7f031a812045dd7784697e1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Diffstat (limited to 'src/plugins/clangcodemodel/clangdswitchdecldef.cpp')
-rw-r--r-- | src/plugins/clangcodemodel/clangdswitchdecldef.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/plugins/clangcodemodel/clangdswitchdecldef.cpp b/src/plugins/clangcodemodel/clangdswitchdecldef.cpp index c39553259c..7773e7fa0e 100644 --- a/src/plugins/clangcodemodel/clangdswitchdecldef.cpp +++ b/src/plugins/clangcodemodel/clangdswitchdecldef.cpp @@ -10,12 +10,13 @@ #include <languageclient/documentsymbolcache.h> #include <languageserverprotocol/lsptypes.h> #include <texteditor/textdocument.h> -#include <utils/optional.h> #include <utils/qtcassert.h> #include <QApplication> #include <QTextCursor> +#include <optional> + using namespace CppEditor; using namespace LanguageClient; using namespace LanguageServerProtocol; @@ -33,7 +34,7 @@ public: cursor(cursor), editorWidget(editorWidget), callback(callback) {} - optional<ClangdAstNode> getFunctionNode() const; + std::optional<ClangdAstNode> getFunctionNode() const; QTextCursor cursorForFunctionName(const ClangdAstNode &functionNode) const; void handleDeclDefSwitchReplies(); @@ -44,8 +45,8 @@ public: const QTextCursor cursor; const QPointer<CppEditorWidget> editorWidget; const LinkHandler callback; - optional<ClangdAstNode> ast; - optional<DocumentSymbolsResult> docSymbols; + std::optional<ClangdAstNode> ast; + std::optional<DocumentSymbolsResult> docSymbols; bool done = false; }; @@ -110,7 +111,7 @@ void ClangdSwitchDeclDef::emitDone() emit done(); } -optional<ClangdAstNode> ClangdSwitchDeclDef::Private::getFunctionNode() const +std::optional<ClangdAstNode> ClangdSwitchDeclDef::Private::getFunctionNode() const { QTC_ASSERT(ast, return {}); @@ -157,7 +158,7 @@ void ClangdSwitchDeclDef::Private::handleDeclDefSwitchReplies() // on a function return type, or ... if (clangdLogAst().isDebugEnabled()) ast->print(0); - const Utils::optional<ClangdAstNode> functionNode = getFunctionNode(); + const std::optional<ClangdAstNode> functionNode = getFunctionNode(); if (!functionNode) { q->emitDone(); return; |