Review Request: don't assume ctor calls in class context

Milian Wolff mail at milianw.de
Tue Apr 13 13:44:47 UTC 2010


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/3581/
-----------------------------------------------------------

Review request for KDevelop and David Nolden.


Summary
-------

This patch does not call checkParameterDeclarationClause when inside a Class-context. In this case, the clash with ctor-calls does not exist, and we can safely assume that every declarator with a parameter_declaration_clause is a function definition.

Before that, things like this:

class asdf {
void foo(NotFound);
signals:
  void bar(NotFound);
private:
  Q_PRIVATE_SLOT(d, void asdf(NotFound)) 
};

would be seen as definitions of
void foo; void bar; void asdf;
note: these would be something like member variables, not even functions!

with my patch they are reported properly as functions with an argument of type NotFound, the type will of course be reddish underlined. No problem is reported, since the usebuilder doesn't do that currently.

This does not make any sense to me. Of course at least slots or normal methods would not compile with missing argument types, yet signals and private slots would still compile. Furthermore I think it's good practice to be more fail-safe as a compiler in an editor.

This patch makes the newly added test in TestDUChain::testSignalSlotDeclaration (currently QEXPECT_FAIL) work. It also fixes the same case for non-signal/slot functions with missing types in their argument list.


Diffs
-----

  /trunk/extragear/sdk/kdevelop/languages/cpp/cppduchain/declarationbuilder.cpp 1114410 

Diff: http://reviewboard.kde.org/r/3581/diff


Testing
-------

all tests pass, including the currently XFAIL in TestDUChain::testSignalSlotDeclaration


Thanks,

Milian





More information about the KDevelop-devel mailing list