Invalid assert in lib/Sema/Lookup.h ?


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?


Umm, actually, I just realized we already have a bug filed for this;
see .


... which I've just fixed in Clang r110615. Please check whether this was the problem!

  - Doug