forked from qt-creator/qt-creator
CppTools: Re-introduce gcc 4.9 __has_include fix
Now the ClangCodeModel makes also use of this. Change-Id: I3d547dffe48e35d3b3d03063bc1a640283d670c1 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user