This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Fix readability-braces-around-statements false positive
ClosedPublic

Authored by curdeius on Oct 13 2016, 7:11 AM.

Details

Summary

This fixes a false-positive e.g. when string literals are returned from if statement.

This patch includes as well a small fix to includes and renames of the test suite that collided with the name of the check.

Event Timeline

curdeius updated this revision to Diff 74510.Oct 13 2016, 7:11 AM
curdeius retitled this revision from to [clang-tidy] Fix readability-braces-around-statements false positive.
curdeius updated this object.
curdeius added a reviewer: alexfh.
curdeius set the repository for this revision to rL LLVM.
curdeius added a project: Restricted Project.
hokein accepted this revision.Oct 13 2016, 7:49 AM
hokein added a reviewer: hokein.
hokein added a subscriber: hokein.

Thanks, LGTM with one nit.

clang-tidy/ReadabilityModuleTest.cpp
488 ↗(On Diff #74510)

Extra blank line.

This revision is now accepted and ready to land.Oct 13 2016, 7:49 AM
curdeius updated this revision to Diff 74624.Oct 14 2016, 1:18 AM
curdeius edited edge metadata.

Remove blank line.

curdeius closed this revision.Oct 14 2016, 1:19 AM
alexfh added inline comments.Nov 8 2016, 2:35 PM
clang-tidy/modernize/UseUsingCheck.cpp
11–12

The change is fine, but it would be better to commit it separately (obviously, no need to do anything now, just for the future).

clang-tidy/readability/BracesAroundStatementsCheck.cpp
64

I'm thoroughly confused as to why the code in your test was not handled correctly and why this is the right fix. Can you explain?