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

Nicolai Hähnle nhaehnle at gmail.com
Sun Aug 30 16:24:47 UTC 2009


Currently, KDevelop does not fully understand the following C-style code:

void foo(struct bar * p)
{
  struct baz * q;
  ...
}

Neither the "bar" nor the "baz" are recognized as uses of the corresponding 
structures. Without the struct keyword, KDevelop understands the example 
correctly, but obviously this is not an option if the code in question is 
actually C code.

This is because the above "struct bar" is parsed as an ElaboratedTypeSpecifier 
instead of a SimpleTypeSpecifier, and then the usebuilder.cpp does different 
things. The attached patch is my suggestion for how to solve this.

I've been using it for a day now without problems, but my entire knowledge of 
the codebase comes from a few hours debugging and code reading, so please just 
tell me if the patch does the Wrong Thing.

cu,
Nicolai
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cppduchain-c-style-declarations.patch
Type: text/x-patch
Size: 2134 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20090830/c6ca81a7/attachment.patch>


More information about the KDevelop-devel mailing list