From ec1905c6fad3bbfea2b990ac3f2256b042ee79b9 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 15 Sep 2022 11:31:29 +0200 Subject: [PATCH] CppEditor: Use "-I" format rather than "-I " ... when constructing the compiler command line. This works around a command line parsing bug in clangd 15.0.0 (https://github.com/clangd/clangd/issues/1292). Change-Id: I7c2e7f443bfededf12db985ff5142f39035d9db6 Reviewed-by: Qt CI Bot Reviewed-by: Cristian Adam Reviewed-by: Reviewed-by: David Schulz --- src/plugins/cppeditor/compileroptionsbuilder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/cppeditor/compileroptionsbuilder.cpp b/src/plugins/cppeditor/compileroptionsbuilder.cpp index d663b227bca..beab068d092 100644 --- a/src/plugins/cppeditor/compileroptionsbuilder.cpp +++ b/src/plugins/cppeditor/compileroptionsbuilder.cpp @@ -334,7 +334,7 @@ void CompilerOptionsBuilder::insertWrappedHeaders(const QStringList &relPaths) static const QString baseDir = creatorResourcePath() + "/cplusplus"; const QString fullPath = baseDir + '/' + relPath; QTC_ASSERT(QDir(fullPath).exists(), continue); - args << includeUserPathOption << QDir::toNativeSeparators(fullPath); + args << (includeUserPathOption + QDir::toNativeSeparators(fullPath)); } const int index = m_options.indexOf(QRegularExpression("\\A-I.*\\z")); @@ -683,7 +683,7 @@ void CompilerOptionsBuilder::addIncludeDirOptionForPath(const HeaderPath &path) return; } - add({includeUserPathOption, QDir::toNativeSeparators(path.path)}); + add(includeUserPathOption + QDir::toNativeSeparators(path.path)); } bool CompilerOptionsBuilder::excludeDefineDirective(const Macro ¯o) const