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`.
Differential D77633
[Parser] Improve diagnostic and error recovery when C++ keywords are used as identifiers. hokein on Apr 7 2020, 1:35 AM. Authored by
Details Previously, clang emitted a less-usefull diagnostic and didnt recover void foo(int case, int x); // previously we drop all parameters after `int case`.
Diff Detail
Unit Tests
Event Timeline
Comment Actions address review comments
Comment Actions This is fairly visible, but seems reasonably safe to me. Let's see if anyone complains :-)
Comment Actions This is cool, thx! One case I stumbled upon recently is: Which results in these rather confusing messages: /tmp/test.cpp:1:14: warning: explicit(bool) is a C++20 extension [-Wc++20-extensions] void explicit() { } ^ /tmp/test.cpp:1:15: error: expected expression void explicit() { } ^ /tmp/test.cpp:1:17: error: expected unqualified-id void explicit() { } ^ 1 warning and 2 errors generated. Just in case you want to continue this ;) |
clang-format-diff not found in user's PATH; not linting file.