[PATCH] D127284: [clang-repl] Support statements on global scope in incremental mode.

Vassil Vassilev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 30 12:02:46 PST 2022


v.g.vassilev marked 3 inline comments as done.
v.g.vassilev added inline comments.


================
Comment at: clang/lib/Parse/ParseDecl.cpp:5395-5400
+  // FIXME: Tell the user this is unsupported.
+  if (!Stmts.empty()) {
+    unsigned ID = Actions.getDiagnostics().getCustomDiagID(
+        DiagnosticsEngine::Error, "Unsupported statement on the global scope");
+    Actions.Diag(Stmts.back()->getBeginLoc(), ID);
+  }
----------------
aaron.ballman wrote:
> Why is this using a custom diagnostic instead of adding a typical diagnostic to DiagnosticParseKinds.td?
I don't have a problem converting this to a DiagnosticParseKind. However, this is a temporary diagnostic and we risk once the FIXME is resolved to leave a stray diagnostic id. 


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

https://reviews.llvm.org/D127284



More information about the cfe-commits mailing list