Summary: | Problems parsing global variables (it jumps to one of the places where they are declared with external) | ||
---|---|---|---|
Product: | [Applications] kdevelop | Reporter: | Amilcar do Carmo Lucas <a.lucas> |
Component: | Language Support: CPP (old) | Assignee: | KDevelop-Devel List <kdevelop-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Amilcar do Carmo Lucas
2003-02-26 10:48:47 UTC
With the new cpp-parser/class viewer This error was partialy solved. Now intead of one instance that when clicked jumps to some wrong location, I get all of the instances shown on the class viewer (the global and correct one, and all the others from the other files that decalare the variable as external). This new behavior is better, but still not perfect. I'm usually moving my "external" declarations to a header file and #include that header instead. In this case the variable shows up only twice, makes you jump to the wrong loaction only half the time :-) The bug is still there. Subject: kdevelop/languages/cpp CVS commit by raggi: skip "external" variable declaration CCMAIL: 55202-done@bugs.kde.org M +8 -1 store_walker.cpp 1.56 M +1 -0 store_walker.h 1.13 --- kdevelop/languages/cpp/store_walker.cpp #1.55:1.56 @@ -42,4 +42,5 @@ void StoreWalker::parseTranslationUnit( m_inSlots = false; m_inSignals = false; + m_inStorageSpec = false; m_anon = 0; m_imports.clear(); @@ -57,5 +58,8 @@ void StoreWalker::parseDeclaration( Decl void StoreWalker::parseLinkageSpecification( LinkageSpecificationAST* ast ) { + int inStorageSpec = m_inStorageSpec; + m_inStorageSpec = true; TreeParser::parseLinkageSpecification( ast ); + m_inStorageSpec = inStorageSpec; } @@ -348,4 +352,7 @@ void StoreWalker::parseTypeDeclaratation void StoreWalker::parseDeclaration( GroupAST* funSpec, GroupAST* storageSpec, TypeSpecifierAST* typeSpec, InitDeclaratorAST* decl ) { + if( m_inStorageSpec ) + return; + DeclaratorAST* d = decl->declarator(); --- kdevelop/languages/cpp/store_walker.h #1.12:1.13 @@ -72,4 +72,5 @@ private: bool m_inSignals; int m_anon; + bool m_inStorageSpec; QValueStack<NamespaceDom> m_currentNamespace; Moving all the bugs from the CPP Parser. It was not well defined the difference between it and C++ Language Support and people kept reporting in both places indistinctively |