Improving support for anonymous struct-types

Milian Wolff mail at milianw.de
Wed Apr 14 10:05:40 UTC 2010


Hi all!

Tobias just hinted me to some strange behavior in the DUChain, in regard to 
support of things like

struct {
  int foo;
} myVar;

If you hover myVar, you'll see:

myVar
Kind: variable definition

i.e. no clue about the type (that it's a struct) at all.

It gets funnier if you do something like

namespace bla {
struct {
  int foo;
} myVar;
}

Now you'll see:

bla:: myVar
Kind: variable definition

The type is bla:: and actually links to the correct struct.

I'm somewhat split on what to think of this. One thing is: It's an anonymous 
struct, it has no name and hence the duchain popups are kinda correct. But to 
me as a user I'd find it much more useful if the duchain would show something 
like:

<anonymous struct> myVar

or

bla::<anonymous struct> myVar

Or even just

struct myVar

and

bla::struct myVar

What do you guys think?

And yes, I'm perfectly aware of the fact that we try to support C++ kickass 
and that this is a more C-ish feature, yet e.g. K_GLOBAL_STATIC uses it 
internally, and it's perfectly fine in Cpp code...
-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20100414/277d46fc/attachment.sig>


More information about the KDevelop-devel mailing list