[cfe-dev] Invalid assert in lib/Sema/Lookup.h ?

Eli Friedman eli.friedman at gmail.com
Mon Aug 9 00:42:59 PDT 2010


On Mon, Aug 9, 2010 at 12:34 AM, Eli Friedman <eli.friedman at gmail.com> wrote:
> On Mon, Aug 9, 2010 at 12:17 AM, EI <geneing at gmail.com> wrote:
>> Hello,
>> What is the meaning of this assert statement in Lookup.h?
>>   void setNotFoundInCurrentInstantiation() {
>>     assert(ResultKind == NotFound && Decls.empty());
>>     ResultKind = NotFoundInCurrentInstantiation;
>>   }
>> I saw assert failing when compiling some code that includes Qt headers. I
>> think the code I was compiling was actually missing some class definitions,
>> so I was expecting to see an error - not a failing assert. Btw, in the
>> debugger I see that ResultKind == NotFoundInCurrentInstantiation when assert
>> statement is reached.
>
> It roughly means that the caller thinks nothing was found when
> something actually was found.  It's hard to say more without more
> information; can you provide a preprocessed file which reproduces the
> issue, or at least a backtrace?

Erm, wait, actually, what's most likely happening is that
LookupQualifiedName is getting called multiple times and failing...
random guess: does -fno-spell-checking help?

-Eli




More information about the cfe-dev mailing list