aaron.ballman 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);
+ }
----------------
v.g.vassilev wrote:
> 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.
It's been my experience that there's nothing more permanent than a temporary
solution, so I'd say we should go with the regular diagnostic. Also, it should
be worded `unsupported statement at global scope` to fit the usual diagnostic
wording style.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D127284/new/
https://reviews.llvm.org/D127284
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits