From 0b6b31b4ba7667226fb7f979f5d03a22c0abf7dc Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Thu, 15 Dec 2022 14:33:36 +0100 Subject: [PATCH] clangformat: Fix compile error Change-Id: Icdf4fcbc1c813557513bc1b0e8e8d2228a668e2b Reviewed-by: hjk --- src/plugins/clangformat/llvmfilesystem.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/clangformat/llvmfilesystem.h b/src/plugins/clangformat/llvmfilesystem.h index cb4fa508602..3be9c29796f 100644 --- a/src/plugins/clangformat/llvmfilesystem.h +++ b/src/plugins/clangformat/llvmfilesystem.h @@ -22,7 +22,7 @@ public: : m_path(FilePath::fromString(QString::fromStdString(Path.str()))) {} /// Destroy the file after closing it (if open). - /// Sub-classes should generally call close() inside their destructors. We + /// Sub-classes should generally call close() inside their destructors. We /// cannot do that from the base class, since close is virtual. ~LlvmFileAdapter() { close(); } @@ -50,8 +50,8 @@ public: Q_UNUSED(IsVolatile); const FilePath path = FilePath::fromString(QString::fromStdString(Name.str())); - const std::optional contents = path.fileContents(FileSize, 0); - QTC_ASSERT(contents, return std::error_code()); + const expected_str contents = path.fileContents(FileSize, 0); + QTC_ASSERT_EXPECTED(contents, return std::error_code()); return MemoryBuffer::getMemBufferCopy(contents->data(), Name); } @@ -108,6 +108,8 @@ public: /// \note The 'end' iterator is directory_iterator(). vfs::directory_iterator dir_begin(const Twine &Dir, std::error_code &EC) override { + Q_UNUSED(Dir); + Q_UNUSED(EC); Q_UNIMPLEMENTED(); return {}; }