Commit 22c95e30 authored by Nikolai Kosjar's avatar Nikolai Kosjar

CppTools: Re-introduce gcc 4.9 __has_include fix

Now the ClangCodeModel makes also use of this.

Change-Id: I3d547dffe48e35d3b3d03063bc1a640283d670c1
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@theqtcompany.com>
parent 48fd79cb
......@@ -705,6 +705,16 @@ bool CompilerOptionsBuilder::excludeDefineLine(const QByteArray &defineLine) con
if (defineLine.startsWith("#define __cplusplus"))
return true;
// gcc 4.9 has:
// #define __has_include(STR) __has_include__(STR)
// #define __has_include_next(STR) __has_include_next__(STR)
// The right-hand sides are gcc built-ins that clang does not understand, and they'd
// override clang's own (non-macro, it seems) definitions of the symbols on the left-hand
// side.
const bool isGccToolchain = m_projectPart->toolchainType == QLatin1String("gcc");
if (isGccToolchain && defineLine.contains("has_include"))
return true;
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment