|
Revision tags: llvmorg-20.1.0, llvmorg-20.1.0-rc3, llvmorg-20.1.0-rc2, llvmorg-20.1.0-rc1, llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1 |
|
| #
2af845a6 |
| 24-Mar-2022 |
Dávid Bolvanský <[email protected]> |
Relands "[Clang] -Wunused-but-set-variable warning - handle also pre/post unary operators"
|
| #
5b6b8405 |
| 24-Mar-2022 |
Dávid Bolvanský <[email protected]> |
Revert "[Clang] -Wunused-but-set-variable warning - handle also pre/post unary operators"
This reverts commit 460fc440ad8d41ca2e3882987512989b1c188fbe.
|
| #
460fc440 |
| 23-Mar-2022 |
Dávid Bolvanský <[email protected]> |
[Clang] -Wunused-but-set-variable warning - handle also pre/post unary operators
Clang fails to diagnose: ``` void test() { int j = 0; for (int i = 0; i < 1000; i++) j++; ret
[Clang] -Wunused-but-set-variable warning - handle also pre/post unary operators
Clang fails to diagnose: ``` void test() { int j = 0; for (int i = 0; i < 1000; i++) j++; return; } ```
Reason: Missing support for UnaryOperator.
We should not warn with volatile variables... so add check for it.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D122271
show more ...
|
|
Revision tags: llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2 |
|
| #
b5b9489b |
| 14-Jun-2021 |
Stephan Bergmann <[email protected]> |
Only consider built-in compound assignment operators for -Wunused-but-set-*
At least LibreOffice has, for mainly historic reasons that would be hard to change now, a class Any with an overloaded ope
Only consider built-in compound assignment operators for -Wunused-but-set-*
At least LibreOffice has, for mainly historic reasons that would be hard to change now, a class Any with an overloaded operator >>= that semantically does not assign to the LHS but rather extracts into the (by-reference) RHS. Which thus caused false positive -Wunused-but-set-parameter and -Wunused-but-set-variable after those have been introduced recently.
This change is more conservative about the assumed semantics of overloaded operators, excluding compound assignment operators but keeping plain operator = ones. At least for LibreOffice, that strikes a good balance of not producing false positives but still finding lots of true ones.
(The change to the BinaryOperator case in MaybeDecrementCount is necessary because e.g. the template f4 test code in warn-unused-but-set-variables-cpp.cpp turns the += into a BinaryOperator.)
Differential Revision: https://reviews.llvm.org/D103949
show more ...
|
| #
cf49cae2 |
| 01-Jun-2021 |
Michael Benfield <[email protected]> |
[Clang] -Wunused-but-set-parameter and -Wunused-but-set-variable
These are intended to mimic warnings available in gcc.
Differential Revision: https://reviews.llvm.org/D100581
|
|
Revision tags: llvmorg-12.0.1-rc1 |
|
| #
14dfb383 |
| 17-May-2021 |
Michael Benfield <[email protected]> |
[Clang] -Wunused-but-set-parameter and -Wunused-but-set-variable
These are intended to mimic warnings available in gcc.
Reviewed By: aeubanks
Differential Revision: https://reviews.llvm.org/D100581
|
| #
9b0501ab |
| 26-Apr-2021 |
Michael Benfield <[email protected]> |
[Clang] -Wunused-but-set-parameter and -Wunused-but-set-variable
These are intended to mimic warnings available in gcc.
-Wunused-but-set-variable is triggered in the case of a variable which appear
[Clang] -Wunused-but-set-parameter and -Wunused-but-set-variable
These are intended to mimic warnings available in gcc.
-Wunused-but-set-variable is triggered in the case of a variable which appears on the LHS of an assignment but not otherwise used.
For instance:
void f() { int x; x = 0; }
-Wunused-but-set-parameter works similarly, but for function parameters instead of variables.
In C++, they are triggered only for scalar types; otherwise, they are triggered for all types. This is gcc's behavior.
-Wunused-but-set-parameter is controlled by -Wextra, while -Wunused-but-set-variable is controlled by -Wunused. This is slightly different from gcc's behavior, but seems most consistent with clang's behavior for -Wunused-parameter and -Wunused-variable.
Reviewed By: aeubanks
Differential Revision: https://reviews.llvm.org/D100581
show more ...
|