From 645f7fc85b813c2d873860eeed3be955a3b61100 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Tue, 1 Nov 2016 14:37:57 +0100 Subject: [PATCH] Clang: Avoid parsing unknown gcc 6 asm output flags Task-number: QTCREATORBUG-17183 Change-Id: I24321cd97acfa3dd71a3682f14af4816bdd08059 Reviewed-by: Christian Kandeler Reviewed-by: Orgad Shaneh --- src/plugins/cpptools/compileroptionsbuilder.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/cpptools/compileroptionsbuilder.cpp b/src/plugins/cpptools/compileroptionsbuilder.cpp index e07d4fcc563..01378ec88e2 100644 --- a/src/plugins/cpptools/compileroptionsbuilder.cpp +++ b/src/plugins/cpptools/compileroptionsbuilder.cpp @@ -433,6 +433,13 @@ bool CompilerOptionsBuilder::excludeDefineDirective(const QByteArray &defineDire return true; } + // MinGW 6 supports some fancy asm output flags and uses them in an + // intrinsics header pulled in by windows.h. Clang does not know them. + if (m_projectPart.toolchainType == ProjectExplorer::Constants::MINGW_TOOLCHAIN_TYPEID + && defineDirective.startsWith("#define __GCC_ASM_FLAG_OUTPUTS__")) { + return true; + } + return false; }