forked from qt-creator/qt-creator
Clang: Fix c++98-compat warnings for MSVC toolchain
Clang invoked with --driver-mode=cl will map "-Wall" to "-Weverything",
thus enabling -Wc++98-compat-pedantic and way more options.
Fix this by escaping "-Wall" in the cl mode, effectively passing in
"/clang:-Wall" instead of "-Wall".
This fixes what 5675169e56 addressed also
for ClangTools.
Change-Id: Ideb7bab923d0359e8039b61e9d53c8765de79c29
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -441,6 +441,7 @@ public:
|
||||
{
|
||||
// Determine the driver mode from toolchain and flags.
|
||||
m_builder.evaluateCompilerFlags();
|
||||
m_isClMode = m_builder.isClStyle();
|
||||
|
||||
addLanguageOptions();
|
||||
addGlobalDiagnosticOptions(); // Before addDiagnosticOptions() so users still can overwrite.
|
||||
@@ -498,7 +499,10 @@ private:
|
||||
? CppTools::UseBuildSystemWarnings::Yes
|
||||
: CppTools::UseBuildSystemWarnings::No;
|
||||
|
||||
m_options.append(diagnosticConfig.clangOptions());
|
||||
const QStringList options = m_isClMode
|
||||
? CppTools::clangArgsForCl(diagnosticConfig.clangOptions())
|
||||
: diagnosticConfig.clangOptions();
|
||||
m_options.append(options);
|
||||
}
|
||||
|
||||
void addGlobalDiagnosticOptions()
|
||||
@@ -537,6 +541,7 @@ private:
|
||||
Core::Id m_diagnosticConfigId;
|
||||
CppTools::UseBuildSystemWarnings m_useBuildSystemWarnings = CppTools::UseBuildSystemWarnings::No;
|
||||
CppTools::CompilerOptionsBuilder m_builder;
|
||||
bool m_isClMode = false;
|
||||
QStringList m_options;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user