forked from qt-creator/qt-creator
Clang: Fix template renaming
Change-Id: I8040fe8dfc99d66e242ce2ff8589aa914838bfc9 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -49,10 +49,9 @@ namespace ClangBackEnd {
|
||||
class FindLocationsOfUSRsASTVisitor : public clang::RecursiveASTVisitor<FindLocationsOfUSRsASTVisitor>
|
||||
{
|
||||
public:
|
||||
explicit FindLocationsOfUSRsASTVisitor(std::vector<USRName> &unifiedSymbolResolutions)
|
||||
explicit FindLocationsOfUSRsASTVisitor(const std::vector<USRName> &unifiedSymbolResolutions)
|
||||
: unifiedSymbolResolutions(unifiedSymbolResolutions)
|
||||
{
|
||||
std::sort(unifiedSymbolResolutions.begin(), unifiedSymbolResolutions.end());
|
||||
}
|
||||
|
||||
bool VisitNamedDecl(const clang::NamedDecl *declaration) {
|
||||
@@ -108,15 +107,17 @@ private:
|
||||
|
||||
bool containsUSR(const USRName &unifiedSymbolResolution)
|
||||
{
|
||||
return std::binary_search(unifiedSymbolResolutions.cbegin(),
|
||||
unifiedSymbolResolutions.cend(),
|
||||
unifiedSymbolResolution);
|
||||
auto found = std::find(unifiedSymbolResolutions.cbegin(),
|
||||
unifiedSymbolResolutions.cend(),
|
||||
unifiedSymbolResolution);
|
||||
|
||||
return found != unifiedSymbolResolutions.cend();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
// All the locations of the USR were found.
|
||||
std::vector<USRName> unifiedSymbolResolutions;
|
||||
const std::vector<USRName> unifiedSymbolResolutions;
|
||||
std::vector<clang::SourceLocation> foundLocations;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user