summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.cpp
Commit message (Collapse)AuthorAgeFilesLines
* (no commit message)Florian Gross2017-05-251-1/+1
| | | | llvm-svn: 303849
* [clang-tidy] readability-braces-around-statements false positive with char ↵Alexander Kornienko2017-05-221-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | literals Summary: Single-line if statements cause a false positive when the last token in the conditional statement is a char constant: ``` if (condition) return 'a'; ``` For some reason `findEndLocation` seems to skips too many (vertical) whitespaces in this case. The same problem already occured with string literals (https://reviews.llvm.org/D25558), and was fixed by adding a special check for this very case. I just extended the condition to also include char constants. No idea what really causes the issue though. Reviewers: alexfh Reviewed By: alexfh Subscribers: xazax.hun, cfe-commits Patch by Florian Gross! Differential Revision: https://reviews.llvm.org/D33354 llvm-svn: 303551
* [clang-tidy] Minor cleanup + a disabled test case for PR26228. NFCAlexander Kornienko2017-05-091-5/+5
| | | | llvm-svn: 302522
* [clang-tools-extra] Format sources with clang-format. NFC.Mandeep Singh Grang2016-11-081-4/+4
| | | | | | | | | | | | | | | | Summary: Ran clang-format on all .c/.cpp/.h files in clang-tools-extra. Excluded the test, unittests, clang-reorder-fields, include-fixer, modularize and pptrace directories. Reviewers: klimek, alexfh Subscribers: nemanjai Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D26329 llvm-svn: 286221
* [clang-tidy] Fix readability-braces-around-statements false positiveMarek Kurdej2016-10-141-1/+1
| | | | | | | | | | | | | | | | | 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. Reviewers: alexfh, hokein Subscribers: hokein Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D25558 llvm-svn: 284212
* [clang-tidy] Fix an assert failure of ForStmt in ↵Haojian Wu2016-02-161-2/+2
| | | | | | | | | | | | `readability-braces-around-statements` check. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D17134 llvm-svn: 260952
* [clang-tidy] Fix an assert failure in 'readability-braces-around-statements' ↵Haojian Wu2016-02-111-1/+4
| | | | | | | | | | | | | | | | | | check. Summary: The check will trigger a assert failure("CondEndLoc.isValid") when checking the IfStmt whose condition expression is not parsed. In this case, we should ignore that. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D17069 llvm-svn: 260505
* [clang-tidy] Don't use diag() for debug outputAlexander Kornienko2015-12-161-11/+3
| | | | llvm-svn: 255765
* [clang-tidy] Fix an assertion in the readability-braces-around-statements check.Alexander Kornienko2015-09-301-0/+10
| | | | llvm-svn: 248895
* Refactors AST matching code to use the new AST matcher names. This patch ↵Aaron Ballman2015-09-171-1/+1
| | | | | | correlates to r247885 which performs the AST matcher rename in Clang. llvm-svn: 247886
* [clang-tidy] Fix PR22785.Alexander Kornienko2015-09-091-5/+10
| | | | | | | | | | | Fix http://llvm.org/PR22785. Bug 22785 - readability-braces-around-statements doesn't work well with macros. http://reviews.llvm.org/D12729 Patch by Marek Kurdej! llvm-svn: 247163
* [clang-tidy] Force braces around leaf 'else if' for consistency.Samuel Benzaquen2015-06-041-3/+11
| | | | | | | | | | | | | | Summary: Force braces around leaf 'else if' for consistency. This complements r233697. Reviewers: alexfh Subscribers: curdeius, cfe-commits Differential Revision: http://reviews.llvm.org/D10245 llvm-svn: 239054
* Force braces on the else branch if they are being added to the if branch.Samuel Benzaquen2015-03-311-10/+12
| | | | | | | | | | | | | | Summary: Force braces on the else branch if they are being added to the if branch. This ensures consistency in the transformed code. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8708 llvm-svn: 233697
* [clang-tidy] Move some of the misc checks to readability/Alexander Kornienko2014-10-151-0/+257
Summary: Some of the misc checks belong to readability/. I'm moving them there without changing check names for now. As the next step, I want to register some of these checks in the google and llvm modules with suitable settings (e.g. BracesAroundStatementsCheck). I'm not sure if we want to create a "readability" module, probably not. Reviewers: djasper Reviewed By: djasper Subscribers: curdeius, cfe-commits Differential Revision: http://reviews.llvm.org/D5792 llvm-svn: 219786
OpenPOWER on IntegriCloud