From 23909058c8a66582cc46ab6f2a7db6744d65c6f9 Mon Sep 17 00:00:00 2001 From: malte_langkabel Date: Wed, 2 Dec 2015 16:38:06 +0100 Subject: [PATCH] logic: fixed infinite loop * fixed infinite loop that occurred when trying to find the source location of an unnamed template parameter. * commented out the deploy settings define. --- src/app/platform_includes/includesWindows.h | 2 +- src/lib/data/parser/cxx/ASTVisitor.cpp | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/app/platform_includes/includesWindows.h b/src/app/platform_includes/includesWindows.h index 808848d5..2d1c99be 100644 --- a/src/app/platform_includes/includesWindows.h +++ b/src/app/platform_includes/includesWindows.h @@ -5,7 +5,7 @@ #include "vld.h" -#define DEPLOY +//#define DEPLOY #ifdef DEPLOY static std::string appSettingsPath = std::string(std::getenv("APPDATA")) + "/../local/Coati Software/Coati/ApplicationSettings.xml"; diff --git a/src/lib/data/parser/cxx/ASTVisitor.cpp b/src/lib/data/parser/cxx/ASTVisitor.cpp index 1414a438..7de6d0c7 100644 --- a/src/lib/data/parser/cxx/ASTVisitor.cpp +++ b/src/lib/data/parser/cxx/ASTVisitor.cpp @@ -458,14 +458,11 @@ bool ASTVisitor::VisitFunctionTemplateDecl(clang::FunctionTemplateDecl *declarat for (size_t i = 0; i < parameterList->size(); i++) { clang::NamedDecl* namedDecl = parameterList->getParam(i); - - if (isLocatedInUnparsedProjectFile(namedDecl)) + if (!namedDecl->getName().empty()) // do not create node for template param if the param has no name { - NameHierarchy templateParameterTypeNameHierarchy = utility::getDeclNameHierarchy(namedDecl); - m_client->onTemplateFunctionParameterTypeParsed( getParseLocationForNamedDecl(namedDecl), - templateParameterTypeNameHierarchy, + utility::getDeclNameHierarchy(namedDecl), templateFunction ); } @@ -915,6 +912,7 @@ ParseLocation ASTVisitor::getParseLocationForIdentifier(const clang::SourceLocat tokenKind != clang::tok::TokenKind::raw_identifier ) { + const clang::PresumedLoc& presumedEndss = sourceManager.getPresumedLoc(identifierToken.getEndLoc()); clang::Lexer::getRawToken(identifierToken.getEndLoc(), identifierToken, sourceManager, clang::LangOptions()); tokenKind = identifierToken.getKind(); }