Debugging in the DeclarationBuilderBase in duchain

David Nolden zwabel at googlemail.com
Wed Nov 12 17:19:33 UTC 2008


Am Dienstag, 11. November 2008 22:37:48 schrieb Esben Mose Hansen:
> Hi,
>
> I am attempting to scratch a serious itch, namely that kdevelop4 crashes on
> some of the files I need to maintain at work. Not knowing exactly what goes
> wrong, I have identified the first suspicious message from the parsing.
>
> DeclarationBuilder::visitTemplateParameter: type-parameter is missing
>
> which originates from declarationbuilder.cpp:159.  After further poking I
> found the following (valid) C++ code to trigger this message:
>
>   template<bool>
>     struct __truth_type
>     {  };
>
> My question is: Is the message supposed to be triggered by valid C++ code?
> Looking at the other message, it looks like it was supposed to be a
> warning, but it is hard for me to understand the intent of this. Changing
> the above code to
>
> template<bool T>
> struct __truth_type
> { };
>
> leads to a drastically different path in that function, which to my
> unexperienced eye looks to be relevant for the first declaration, too. E.g,
> surely the duchain must know about the template parameter, even if it
> doesn't have an actual name? But that code is simply skipped in the first,
> message- producing case.
>
> With the hope of enlightenment,

Hi! Nice you're trying to scratch your itch. :) This thing is probably not 
related to your crash though.

What you found is that we don't create declarations for template-parameters 
that don't have a name. This probably should be fixed, because some code 
might rely on one declaration being there for each parameter. But a 
declaration also isn't worth much without a name. Anyway, I think I will fix 
this.

Greetings, David




More information about the KDevelop-devel mailing list