| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=44745 | readability-else-after-return crashes ]]
Reviewers: aaron.ballman, alexfh, hokein, JonasToth, gribozavr2
Reviewed By: alexfh
Subscribers: merge_guards_bot, xazax.hun, cfe-commits
Tags: #clang, #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D73841
(cherry picked from commit d591bdce6d623208d4aeb335a762d839f0f8f0f7)
|
|
|
|
|
|
|
|
|
|
| |
Adds a new ASTMatcher condition called 'hasInitStatement()' that matches if,
switch and range-for statements with an initializer. Reworked clang-tidy
readability-else-after-return to handle variables in the if condition or init
statements in c++17 ifs. Also checks if removing the else would affect object
lifetimes in the else branch.
Fixes PR44364.
|
|
|
|
|
|
|
|
|
| |
The readability-else-after-return check should be smarter about cases where the
variable defined in the condition is used in the `else` branch. This patch makes
it just ignore such cases, but alternative solutions may be better (added a
FIXME).
llvm-svn: 351751
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to reflect the new license.
We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.
Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.
llvm-svn: 351636
|
|
|
|
|
|
|
| |
a stray single '\r' from one file. These are the last line ending issues
I can find in the files containing parts of LLVM's file headers.
llvm-svn: 351634
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
constexpr if.
Summary:
It fixes the false positive when using constexpr if and where else cannot be removed:
Example:
```
if constexpr (sizeof(int) > 4)
// ...
return /* ... */;
else // This else cannot be removed.
// ...
return /* ... */;
```
Reviewers: alexfh, aaron.ballman
Reviewed By: aaron.ballman
Subscribers: lebedev.ri, xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D53372
llvm-svn: 344785
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The readability-else-after-return check was not warning about
an else after a throw of an exception that had arguments that needed
to be cleaned up.
Reviewers: aaron.ballman, alexfh, djasper
Reviewed By: aaron.ballman
Subscribers: lebedev.ri, klimek, xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D40505
llvm-svn: 319174
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Fix generated by this check changed program semantics
in the case where 'if' was a part (direct child) of other statement.
Fixes PR30652.
Patch by Paweł Żukowski.
Reviewers: malcolm.parsons, alexfh, djasper
Subscribers: mgehre, omtcyfz, cfe-commits
Differential Revision: https://reviews.llvm.org/D26125
llvm-svn: 285999
|
|
|
|
|
|
|
|
|
|
|
|
| |
`readability-else-after-return` only warns about `return` calls, but LLVM Coding
Standars stat that `throw`, `continue`, `goto`, etc after `return` calls are
bad, too.
Reviwers: alexfh, aaron.ballman
Differential Revision: https://reviews.llvm.org/D23265
llvm-svn: 278257
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Refactor some checkers to use the tooling re-writing API.
see: http://reviews.llvm.org/D19941
Reviewers: klimek, alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D19807
llvm-svn: 269210
|
|
|
|
|
|
|
| |
might be a little too strict now, but better be too strict than do the
wrong thing.
llvm-svn: 235932
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
clang::tidy::readability
clang-tidy checks are organized into modules. This refactoring moves the
readability module checks into the namespace clang::tidy::readability
http://reviews.llvm.org/D7997
Patch by Richard Thomson!
llvm-svn: 230946
|
|
As per the LLVM coding standards:
http://llvm.org/docs/CodingStandards.html#don-t-use-else-after-a-return
Initial version, probably still quite a bit to do until this is really
useful.
Review: http://reviews.llvm.org/D6927
llvm-svn: 226025
|