[PATCH] D50462: Try building complete AST after a fatal error was emitted if further diagnostics are expected

Dmitry via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 15 10:45:27 PDT 2018


Dmitry.Kozhevnikov added a comment.

In https://reviews.llvm.org/D50462#1193180, @arphaman wrote:

> On a second look I think that there is value separating the concepts of 'producing diagnostics' after hitting the fatal error (which is SuppressAfterFatalError currently does), and trying to build a more complete AST.


Sorry for the delay.

I've introduced an accordingly-named method. I haven't created another flag yet, though, because it feels a bit weird currently since there are no clients that require it, added a todo note instead. What do you think?



================
Comment at: unittests/Frontend/PCHPreambleTest.cpp:220
+    "#include \"//./header2.h\"\n"
+    "Alias Var;");
+
----------------
The condition in `SemaTemplateInstantiate.cpp` was causing the lookup of `Alias` to fail: it was marked as invalid and wasn't stored in the preamble. I'll be happy to make a more straightforward test, but I've not yet managed to: when placing everything in a single file, the lookup succeeds.


Repository:
  rC Clang

https://reviews.llvm.org/D50462





More information about the cfe-commits mailing list