diff options
author | Nikolai Kosjar <nikolai.kosjar@theqtcompany.com> | 2015-06-29 13:16:59 +0200 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@theqtcompany.com> | 2015-06-29 14:44:25 +0000 |
commit | 22c95e302445f10757deb03718d6ed81ff08ea3a (patch) | |
tree | 98e02b45833c71227d88209edcebd935a6bd9ee1 /src/plugins/cpptools/cppprojects.cpp | |
parent | 48fd79cb0b7366ce695a99496373d4627f13b9fa (diff) | |
download | qt-creator-22c95e302445f10757deb03718d6ed81ff08ea3a.tar.gz |
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>
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; } |