Improving support for anonymous struct-types

Milian Wolff mail at milianw.de
Fri Apr 16 12:16:23 UTC 2010


On Wednesday 14 April 2010 12:05:40 Milian Wolff wrote:
> 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

Just got this in GDB, which strengthens my point and shows us what do use:

can't find linker symbol for virtual table for `QMetaObject::<anonymous 
struct>' value

So we should also print bla::<anonymous struct>.
-- 
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/20100416/2a4de4da/attachment.sig>


More information about the KDevelop-devel mailing list