forked from qt-creator/qt-creator
Clang: Don't analyze same file multiple times
Diagnostics do not depend much on project parts. But having the same file twice can result in duplicated diagnostics which later can cause the same fix-it being applied twice and getting corrupted code. Change-Id: Ie2809af7a54034b05df9383875f7c3123aea58e8 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -78,13 +78,13 @@ static FileInfos sortedFileInfos(const QVector<CppTools::ProjectPart::Ptr> &proj
|
||||
continue;
|
||||
|
||||
if (CppTools::ProjectFile::isSource(file.kind)) {
|
||||
const FileInfo info{Utils::FileName::fromString(file.path), file.kind, projectPart};
|
||||
fileInfos.append(info);
|
||||
fileInfos.emplace_back(Utils::FileName::fromString(file.path), file.kind, projectPart);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Utils::sort(fileInfos, &FileInfo::file);
|
||||
fileInfos.erase(std::unique(fileInfos.begin(), fileInfos.end()), fileInfos.end());
|
||||
|
||||
return fileInfos;
|
||||
}
|
||||
|
Reference in New Issue
Block a user