9d09611d77
Implicit instantiation of a function template calls `DeclCollector::HandleCXXImplicitFunctionInstantiation()`, which appends the FunctionDecl to the transaction. According to clang documentation, the body of the function has not yet been instantiated. `HandleTopLevelDecl()` will be called again for this decl at the end of the TU, which will append it again to the transaction - same `Decl *`, different ConsumerCallInfo. This is by design. However, unloading of decls in the transaction should not process the same `Decl *` twice. In particular, entries with ConsumerCallInfo == `kCCIHandleCXXImplicitFunctionInstantiation` will omitted. Fixes issue #9850.