[Parser] Improve diagnostic and error recovery when C++ keywords are used as identifiers.
authorHaojian Wu <hokein.wu@gmail.com>
Wed, 8 Apr 2020 13:08:48 +0000 (15:08 +0200)
committerHaojian Wu <hokein.wu@gmail.com>
Wed, 8 Apr 2020 13:15:33 +0000 (15:15 +0200)
commit625acd8f6847a156b236b8f11b4b02b11cac3766
treedbcd205209b8d11a94b4d9659b7e1cf3f5cad337
parent6c4b40def77622a5cf62a219ef4af63dc876e144
[Parser] Improve diagnostic and error recovery when C++ keywords are used as identifiers.

Summary:
Previously, clang emitted a less-usefull diagnostic and didnt recover
well when the keywords is used as identifier in function paramter.

```
void foo(int case, int x); // previously we drop all parameters after
`int case`.
```

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D77633
clang/include/clang/Basic/DiagnosticParseKinds.td
clang/lib/Parse/ParseDecl.cpp
clang/test/Parser/cxx-keyword-identifiers.cpp [new file with mode: 0644]