Review Request: Offer create private/protected members when possible in missingdeclarationaction

Jonas Jacobi jonas.jacobi at web.de
Thu Sep 15 19:57:26 UTC 2011


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

Review request for KDevelop.


Summary
-------

Currently only public member variables can be declared in some contexts.
This patch checks whether private/protected members would be also accessible from the current context (disregarding friend declarations atm)
and if so, offer the possibility to create the members.
e.g.

class A {
public:
  A(int x) : mUndeclared(x) {} // <- declare mUndeclared as private/protected/public member
};

class B : public A {
public:
  void foo() {
    A a(2);
    a.undeclared = 5; // <- declare undeclared as protected/public
  }
};

class X {
public:
  void bar() {
    B b;
    b.undeclared = 5; // <- declare undeclared as public
  }
};


Diffs
-----

  languages/cpp/cppduchain/missingdeclarationassistant.cpp bafc159 
  projectbuilders/makebuilder/imakebuilder.h 26a22e1 

Diff: http://git.reviewboard.kde.org/r/102625/diff


Testing
-------

I'm currently using it


Thanks,

Jonas

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20110915/f766ff7a/attachment.html>


More information about the KDevelop-devel mailing list