This is an archive of the discontinued LLVM Phabricator instance.

[Format] Add format check for throwing negative numbers
ClosedPublic

Authored by jonathoma on Oct 17 2019, 2:40 PM.

Details

Summary

The code throw -1; is currently formatted by clang-format as
throw - 1;. This diff adds a fix for this edge case and a test to check
for this in the future.

For context, I am looking into a related bug in the clang-formatting of
coroutine keywords: co_yield -1; is also reformatted in this manner
as co_yield - 1;. A later diff will add these changes and tests for the
co_yield and co_return keywords.

Diff Detail