If error was encountered after template instantiation, the clang-repl interactive mode was aborted. The patch adds recovery support for template instantiation
Eg:
purva@purva-HP-Laptop-15-bs0xx:~/llvm-project/build$ bin/clang-repl clang-repl> template<class T> T f() { return T(); } clang-repl> auto ptu2 = f<float>(); err; In file included from <<< inputs >>>:1: input_line_1:1:25: error: C++ requires a type specifier for all declarations auto ptu2 = f<float>(); err; ^ clang-repl: /home/purva/llvm-project/clang/include/clang/Sema/Sema.h:9406: clang::Sema::GlobalEagerInstantiationScope::~GlobalEagerInstantiationScope(): Assertion `S.PendingInstantiations.empty() && "PendingInstantiations should be empty before it is discarded."' failed. Aborted (core dumped)
I suspect we should create this object earlier in this function. Can you export the diff with more context like suggested here https://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-web-interface