[PATCH] cppduchain: Understand C-style use of struct in declarations

David Nolden david.nolden.kdevelop at art-master.de
Sat Sep 5 16:54:26 UTC 2009


Am Mittwoch 02 September 2009 23:34:04 schrieb Nicolai Hähnle:
> Am Monday 31 August 2009 13:23:52 schrieb David Nolden:
> > Am Sonntag 30 August 2009 18:24:47 schrieb Nicolai Hähnle:
> > > Currently, KDevelop does not fully understand the following C-style
> > > code:
> > >
> > > void foo(struct bar * p)
> > > {
> > >   struct baz * q;
> > >   ...
> > > }
> 
> <snip>
> 
> > I guess your fix is correct. But I think this already worked at some
> > point, which makes clear that this needs a unit-test, to verify that the
> > patch works, and that it stays working.
> >
> > See kdevelop/languages/cpp/cppduchain/tests/test_duchain.cpp, the test
> > could be another compound statement within testDeclareStruct. Can you
> > create such a test?
> 
> Okay, see the attached patch. First one adds a test-case, the second is
>  just a resend of my earlier patch.
> 
> For the test-case, I am mostly relying on checking that the number of uses
>  of the struct and its member are correct. From what I understand, this
>  should ensure that the types are assigned correctly.
> 
> cu,
> Nicolai
> 

Thanks, committed now.





More information about the KDevelop-devel mailing list