Two duchain bugs

Bertjan Broeksema bertjan at kdab.net
Wed Sep 30 14:35:18 UTC 2009


Hi All,

I've found two bugs in the (C++) use builder.

1) I build a AbstractType for "const std::string&" by using the 
ExpressionParser. Next I look up the class declaration of QString, iterate 
over its constructors and compare the type with the AbstractType created by 
the ExpressionParser.

pseudo code:

ExpressionParser parser;
AbstractType::Ptr strType = parser.parse("const std::string&");

foreach (FunctionDecl *ctor, qStringClassDecl->localUses("QString"))
  if (ctor->arguments().first->equal(strType())
     // The equal here is AbstractType::equal();
    do_my_stuff;
 
Curiously this *does* work sometime but not all the time.

2) Given the declaration of QString::QString(const std::string&), the only 
uses reported are explicit calls to this ctor and not the implicit ones.

i.e.
std::string myStr("test");
QString s1 = QString(myStr); // Found!
QString s1(myStr);                // Not found!

Comments/thoughts? Might be that I'm expecting the wrong things from the 
framework but both seem bugs to me.

Cheers,

Bertjan




More information about the KDevelop-devel mailing list