diff options
Diffstat (limited to 'src/plugins/cpptools/cppprojects.cpp')
-rw-r--r-- | src/plugins/cpptools/cppprojects.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppprojects.cpp b/src/plugins/cpptools/cppprojects.cpp index 0792f20661..17e197c1cf 100644 --- a/src/plugins/cpptools/cppprojects.cpp +++ b/src/plugins/cpptools/cppprojects.cpp @@ -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; } |