[PATCH] D125944: Template instantiation error recovery

Purva Chaudhari via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 31 20:22:03 PDT 2022


Purva-Chaudhari added a comment.

In D125944#3689022 <https://reviews.llvm.org/D125944#3689022>, @v.g.vassilev wrote:

> @Purva-Chaudhari can you rebase this patch?

Yes. I realized I would have to rebase



================
Comment at: clang/lib/Interpreter/IncrementalParser.cpp:180
   DiagnosticsEngine &Diags = getCI()->getDiagnostics();
+  Sema::PerformPendingInstantiationsRAII PerformPendingInstantiations(S);
   if (Diags.hasErrorOccurred()) {
----------------
v.g.vassilev wrote:
> 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
Let me try it out


================
Comment at: clang/test/Interpreter/execute.cpp:2
+// RUN: clang-repl "template<class T> T f() { return T(); }" "auto ptu2 = f<float>(); err;" \
+// RUN: "auto ptu2 = f<float>();" "int i = 0;"
 // RUN: clang-repl "int i = 10;" 'extern "C" int printf(const char*,...);' \
----------------
v.g.vassilev wrote:
> Can you move this test into a separate file which is dedicated for testing recovery of templates?
Yes updating the commit


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125944/new/

https://reviews.llvm.org/D125944



More information about the cfe-commits mailing list