From 0366a8aadb349375062b9757ddd398c5f4f44af7 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Mon, 23 Mar 2020 22:16:46 +0100 Subject: [PATCH] ClangFormat: Compile fix for MSVC When vanilla LLVM/Clang is used the #warning statement causes actually an error on MSVC. Change-Id: Id3f36efc1b21d48e52a9c44036b99a5b4d9a0d5c Reviewed-by: Eike Ziller --- src/plugins/clangformat/clangformatplugin.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/clangformat/clangformatplugin.cpp b/src/plugins/clangformat/clangformatplugin.cpp index 561b7e888ec..2ebef54584d 100644 --- a/src/plugins/clangformat/clangformatplugin.cpp +++ b/src/plugins/clangformat/clangformatplugin.cpp @@ -153,10 +153,12 @@ bool ClangFormatPlugin::initialize(const QStringList &arguments, QString *errorS } return true; #else +#ifndef Q_CC_MSVC #warning ClangFormat: building dummy plugin due to unmodified Clang, see README.md for more info - *errorString = "Disabling ClangFormat plugin as it has not been built against a modified Clang's libFormat." +#endif + *errorString = QStringLiteral("Disabling ClangFormat plugin as it has not been built against a modified Clang's libFormat." "For more information see the Qt Creator README at " - "https://code.qt.io/cgit/qt-creator/qt-creator.git/tree/README.md"; + "https://code.qt.io/cgit/qt-creator/qt-creator.git/tree/README.md"); return false; #endif }