Merge remote-tracking branch 'origin/4.6'

Conflicts:
	src/libs/utils/settingsaccessor.cpp
	src/plugins/autotest/autotestplugin.cpp
	src/plugins/git/gitclient.cpp
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp
	src/plugins/qbsprojectmanager/qbsrunconfiguration.h

Change-Id: I65f143cad18af509a2621d6c5925abbd038ea70f
This commit is contained in:
Eike Ziller
2018-04-13 10:54:42 +02:00
61 changed files with 1137 additions and 90 deletions

View File

@@ -237,6 +237,17 @@ static bool isHeaderErrorDiagnostic(const Utf8String &mainFilePath, const Diagno
return isCritical && diagnostic.location().filePath() != mainFilePath;
}
static bool isIgnoredHeaderErrorDiagnostic(const Diagnostic &diagnostic)
{
// FIXME: This diagnostic can appear if e.g. a main file includes a -isystem header and then the
// header is opened in the editor - the provided unsaved file for the newly opened editor
// overrides the file from the preamble. In this case, clang uses the version from the preamble
// and changes in the header are not reflected in the main file. Typically that's not a problem
// because only non-project headers are opened as -isystem headers.
return diagnostic.text().endsWith(
Utf8StringLiteral("from the precompiled header has been overridden"));
}
void TranslationUnit::extractDiagnostics(DiagnosticContainer &firstHeaderErrorDiagnostic,
QVector<DiagnosticContainer> &mainFileDiagnostics) const
{
@@ -246,7 +257,9 @@ void TranslationUnit::extractDiagnostics(DiagnosticContainer &firstHeaderErrorDi
bool hasFirstHeaderErrorDiagnostic = false;
for (const Diagnostic &diagnostic : diagnostics()) {
if (!hasFirstHeaderErrorDiagnostic && isHeaderErrorDiagnostic(m_filePath, diagnostic)) {
if (!hasFirstHeaderErrorDiagnostic
&& isHeaderErrorDiagnostic(m_filePath, diagnostic)
&& !isIgnoredHeaderErrorDiagnostic(diagnostic)) {
hasFirstHeaderErrorDiagnostic = true;
firstHeaderErrorDiagnostic = diagnostic.toDiagnosticContainer();
}