[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/kdevelop/3.4/languages/cpp
From: David Nolden <david.nolden.kde () art-master ! de>
Date: 2006-09-07 17:39:52
Message-ID: 1157650792.890839.10830.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 581840 by zwabel:
resolve a bug in the tag-creator: Base-classes that are nested within a namespace are \
handled correctly now(no more KDocument::KDocument::Document etc.). Finally \
workaround the constructor/class shadowing-problem(the reason is that the parser \
somewhere places constructor-definitions into the global namespace, but I cannot find \
the position where it's done).
M +3 -4 cppcodecompletion.cpp
M +7 -2 cppevaluation.cpp
M +1 -1 cppsupportpart.cpp
M +3 -3 simpletype.cpp
M +5 -17 tag_creator.cpp
--- branches/kdevelop/3.4/languages/cpp/cppcodecompletion.cpp #581839:581840
@@ -490,13 +490,13 @@
TypeDesc::TemplateParams p = d->templateParams();
for( TypeDesc::TemplateParams::iterator it = p.begin(); it != p.end(); ++it ){
- if( (*it)->resolved() ) {
+ //if( (*it)->resolved() ) {
QPopupMenu * m = new QPopupMenu( parent );
int gid = parent->insertItem( i18n( "Template-param \"%1\"" ).arg( \
cleanForMenu( (*it)->fullNameChain() ) ), m ); fill( m, **it );
- } else {
+ /*} else {
fill( parent, **it, prefix + depthAdd );
- }
+ }*/
}
if( d->resolved() ) {
@@ -1723,7 +1723,6 @@
ret.resultType = ctx->container()->locateDecType( exp.expr() );
ret.expr = exp;
}
-
}
}
if( /*exp.canBeNormalExpression() &&*/ !ret.resultType->resolved() ) { ///It is \
not cleary possible to recognize the kind of an expression from the syntax as long as \
it's not written completely
--- branches/kdevelop/3.4/languages/cpp/cppevaluation.cpp #581839:581840
@@ -407,7 +407,7 @@
canBeTypeExpression = true;*/
if( canBeItemExpression && (!bestRet || bestDepth > 0 ) ) {
-
+ SimpleTypeImpl::
SimpleTypeImpl::TypeOfResult res = searchIn->typeOf( expr );
if( res ) {
@@ -419,7 +419,12 @@
///Search for Types
SimpleTypeImpl::LocateResult type = searchIn->locateDecType( expr );
- if( !bestRet || (type->resolved() && ( type.depth() <= bestRet->depth()) ) ) {
+ ///Somewhere it seems to happen that constructor-definitions are placed into the \
same namespace as the classes themselves, so they may shadow them. This hackish code \
tries to deal with that, it would be better to find the position where that's done \
and maybe eliminate the behavior. + if( !bestRet ||
+ /** Did we find a constructor within a class? */
+ (type->resolved() && ( bestRet->resolved() && type->resolved()->desc() == \
bestRet->resolved()->parent()->desc() && bestRet->resolved()->asFunction() ) ) || \
+ /** Did we find a constructor on the same level as the class? */ \
+ ((type->resolved() && ( bestRet->resolved() && type->resolved()->parent()->desc() \
== bestRet->resolved()->parent()->desc() && bestRet->resolved()->asFunction() ) )) ) \
{ /*if ( type && type->resolved() )
{*/
EvaluationResult ret = type;
--- branches/kdevelop/3.4/languages/cpp/cppsupportpart.cpp #581839:581840
@@ -104,7 +104,7 @@
const bool alwaysParseInBackground = false;
-enum { KDEV_DB_VERSION = 12 };
+enum { KDEV_DB_VERSION = 13 };
enum { KDEV_PCS_VERSION = 10 };
QStringList CppSupportPart::m_sourceMimeTypes = QStringList() << "text/x-csrc" << \
"text/x-c++src";
--- branches/kdevelop/3.4/languages/cpp/simpletype.cpp #581839:581840
@@ -489,7 +489,7 @@
return t.increaseDepth();
else
if( t > ret )
- ret = t;
+ ret = t.increaseDepth();
}
}
}
@@ -501,7 +501,7 @@
return rett.increaseDepth();
else
if( rett > ret )
- ret = rett;
+ ret = rett.increaseDepth();
}
///Ask the bases and allow them to search in their parents.
@@ -516,7 +516,7 @@
return t.increaseDepth();
else
if( t > ret )
- ret = t;
+ ret = t.increaseDepth();
}
}
}
--- branches/kdevelop/3.4/languages/cpp/tag_creator.cpp #581839:581840
@@ -735,24 +735,12 @@
access = baseSpecifier->access() ->text();
bool isVirtual = baseSpecifier->isVirtual() != 0;
- QString baseName;
if( baseSpecifier->name() == 0 ) return; ///Workaround for some bug elsewhere
-
- QPtrList<ClassOrNamespaceNameAST> l = baseSpecifier->name() \
->classOrNamespaceNameList();
- QPtrListIterator<ClassOrNamespaceNameAST> nameIt( l );
- while ( nameIt.current() )
- {
- if ( nameIt.current() ->name() )
- {
- baseName += nameIt.current() ->name() ->text() + "::";
- }
- ++nameIt;
- }
-
- if ( baseSpecifier->name() ->unqualifiedName() && baseSpecifier->name() \
->unqualifiedName() ->name() )
- baseName += baseSpecifier->name() ->text(); ///I changed this because I need the \
template-information. I hope it has no bad side-effects.
- //baseSpecifier->name() ->unqualifiedName() ->name() ->text();
-
+
+ QString baseName;
+ if ( baseSpecifier->name() )
+ baseName = baseSpecifier->name() ->text();
+
Tag tag;
CppBaseClass<Tag> tagBuilder( tag );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic