[PATCH] D77633: [Parser] Improve diagnostic and error recovery when C++ keywords are used as identifiers.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 8 04:49:47 PDT 2020


sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.

This is fairly visible, but seems reasonably safe to me. Let's see if anyone complains :-)



================
Comment at: clang/test/Parser/cxx-keyword-identifiers.cpp:16
+int foo5(int x const); // expected-error {{expected ')'}} expected-note {{to match this '('}}
+int foo6(int case __attribute((weak))); // expected-error {{invalid parameter}}  \
+                                        // expected-error {{expected ')'}} expected-note {{to match this '('}}
----------------
can you add a comment like FIXME: bad recovery?

(So future readers/modifiers can know which tests are establishing desirable behavior vs documenting current accidental behavior)

Actually I think this is better than the old behaviour (but ideally we'd suppress the followon diagnostic)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77633





More information about the cfe-commits mailing list