| Summary: | class browser and structures | ||
|---|---|---|---|
| Product: | [Applications] kdevelop | Reporter: | Sven Schmidt <sschmidt> |
| Component: | Language Support: CPP (old) | Assignee: | KDevelop Developers <kdevelop-devel> |
| Status: | RESOLVED FIXED | ||
| Severity: | wishlist | ||
| Priority: | NOR | ||
| Version First Reported In: | git master | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Sven Schmidt
2003-10-29 12:47:01 UTC
Use:
struct RGB_STR
{
//�bermalen oder nicht
int f;
//RGB-Werte des Punktes
int r;
int g;
int b;
}
And it will work.
Are you using KDevelop 3.0.0 Beta 1 ?
Subject: kdevelop/languages/cpp
CVS commit by raggi:
now the class store works with C-style typedef/struct definitions like
typedef struct
{
int z;
} DATA;
CCMAIL: 66825-done@bugs.kde.org
M +15 -1 store_walker.cpp 1.57
M +3 -1 store_walker.h 1.14
--- kdevelop/languages/cpp/store_walker.cpp #1.56:1.57
@@ -43,4 +43,6 @@ void StoreWalker::parseTranslationUnit(
m_inSignals = false;
m_inStorageSpec = false;
+ m_inTypedef = false;
+ m_currentDeclarator = 0;
m_anon = 0;
m_imports.clear();
@@ -110,5 +112,15 @@ void StoreWalker::parseUsingDirective( U
void StoreWalker::parseTypedef( TypedefAST* ast )
{
+ DeclaratorAST* oldDeclarator = m_currentDeclarator;
+
+ if( ast && ast->initDeclaratorList() && ast->initDeclaratorList()->initDeclaratorList().count() > 0 ) {
+ QPtrList<InitDeclaratorAST> lst( ast->initDeclaratorList()->initDeclaratorList() );
+ m_currentDeclarator = lst.at( 0 )->declarator();
+ }
+
+ m_inTypedef = true;
TreeParser::parseTypedef( ast );
+ m_inTypedef = false;
+ m_currentDeclarator = oldDeclarator;
}
@@ -260,5 +272,7 @@ void StoreWalker::parseClassSpecifier( C
QString className;
- if( !ast->name() ){
+ if( !ast->name() && m_currentDeclarator && m_currentDeclarator->declaratorId() ) {
+ className = m_currentDeclarator->declaratorId()->text().stripWhiteSpace();
+ } else if( !ast->name() ){
QFileInfo fileInfo( m_fileName );
QString shortFileName = fileInfo.baseName();
--- kdevelop/languages/cpp/store_walker.h #1.13:1.14
@@ -73,5 +73,7 @@ private:
int m_anon;
bool m_inStorageSpec;
+ bool m_inTypedef;
+ DeclaratorAST* m_currentDeclarator;
QValueStack<NamespaceDom> m_currentNamespace;
QValueStack<ClassDom> m_currentClass;
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 |