<html><body><div>Hello,</div><div><br></div><div>I'm using libclang, and when using clang_reparseTranslationUnit method, I (nearly?) always get a crash:</div><div><br></div><div><div>Assertion failed: ((LatestDecl->getLocation().isInvalid() || NewLatest->getLocation().isInvalid() || !Reader.SourceMgr.isBeforeInTranslationUnit( NewLatest->getLocation(), LatestDecl->getLocation())) && "The new latest is supposed to come after the previous latest"), function VisitRedeclarableTemplateDecl, file /data/clang-llvm/llvm/tools/clang/lib/Serialization/ASTReaderDecl.cpp, line 1094.</div><div>libclang: crash detected during reparsing</div></div><div><br></div><div>When I turn off <span class="Apple-style-span" style="font-family: Helvetica, Arial, Verdana, sans-serif; white-space: pre; ">CXTranslationUnit_CXXPrecompiledPreamble, things work fine (although quite a bit slower).</span></div><div><span class="Apple-style-span" style="font-family: Helvetica, Arial, Verdana, sans-serif; white-space: pre; "><br></span></div><div><span class="Apple-style-span" style="font-family: Helvetica, Arial, Verdana, sans-serif; white-space: pre; ">Does anybody have an idea how I can debug this, or in which direction I should look?</span></div><div><span class="Apple-style-span" style="font-family: Helvetica, Arial, Verdana, sans-serif; white-space: pre; "><br></span></div><div><span class="Apple-style-span" style="font-family: Helvetica, Arial, Verdana, sans-serif; white-space: pre; ">Regards,</span></div><div><span class="Apple-style-span" style="font-family: Helvetica, Arial, Verdana, sans-serif; white-space: pre; ">Erik.</span></div></body></html>