summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/modernize-redundant-void-arg.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [ClangTidy] Separate tests for infrastructure and checkersDmitri Gribenko2019-10-111-558/+0
| | | | | | | | | | | | | | | | | | | | Summary: This change moves tests for checkers and infrastructure into separate directories, making it easier to find infrastructure tests. Tests for checkers are already easy to find because they are named after the checker. Tests for infrastructure were difficult to find because they were outnumbered by tests for checkers. Now they are in a separate directory. Reviewers: jfb, jdoerfert, lebedev.ri Subscribers: srhines, nemanjai, aheejin, kbarton, christof, mgrang, arphaman, jfb, lebedev.ri, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68807 llvm-svn: 374540
* [clang-tidy] Fix PR28406Alexander Kornienko2019-03-291-0/+7
| | | | | | | | Fix the crash resulting from a careless use of getLocWithOffset. At the beginning of a macro expansion it produces an invalid SourceLocation that causes an assertion failure later on. llvm-svn: 357312
* FixIdriss Riouak2018-09-171-4/+4
| | | | llvm-svn: 342389
* [Clang-Tidy: modernize] Fix for modernize-redundant-void-arg: complains ↵Idriss Riouak2018-09-171-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | about variable cast to void Summary: Hello, i would like to suggest a fix for one of the checks in clang-tidy.The bug was reported in https://bugs.llvm.org/show_bug.cgi?id=32575 where you can find more information. For example: ``` template <typename T0> struct S { template <typename T> void g() const { int a; (void)a; } }; void f() { S<int>().g<int>(); } ``` this piece of code should not trigger any warning by the check modernize-redundant-void-arg but when we execute the following command ``` clang_tidy -checks=-*,modernize-redundant-void-arg test.cpp -- -std=c++11 ``` we obtain the following warning: /Users/eco419/Desktop/clang-tidy.project/void-redundand_2/test.cpp:6:6: warning: redundant void argument list in function declaration [modernize-redundant-void-arg] (void)a; ^~~~ Reviewers: aaron.ballman, hokein, alexfh, JonasToth Reviewed By: aaron.ballman, JonasToth Subscribers: JonasToth, lebedev.ri, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D52135 llvm-svn: 342388
* [clang-tidy: modernize] modernize-redundant-void-arg crashes when a function ↵Alexander Kornienko2018-08-101-0/+43
| | | | | | | | | | | | body is in a macro Fixes https://bugs.llvm.org/show_bug.cgi?id=28406 Patch by IdrissRio. Differential revision: https://reviews.llvm.org/D49800 llvm-svn: 339433
* Add support for type aliases to modernize-redundant-void-arg.cppAaron Ballman2016-04-141-0/+6
| | | | | | Patch by Clement Courbet. llvm-svn: 266358
* Fix another crash in the redundant-void-arg check.Angel Garcia Gomez2015-11-021-0/+6
| | | | | | | | | | | | Summary: The check was assuming that a definition of a function always has a body, but a declaration that explicitly defaults or deletes a function is a definition too. Reviewers: alexfh Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D14238 llvm-svn: 251807
* Fix crash in redundant-void-arg check.Angel Garcia Gomez2015-11-021-0/+16
| | | | | | | | | | | | | | Summary: When applying this check to the unit tests, it would hit an assertion: llvm/tools/clang/lib/Lex/Lexer.cpp:1056: clang::SourceLocation clang::Lexer::getSourceLocation(const char*, unsigned int) const: Assertion `PP && "This doesn't work on raw lexers"' failed. Reviewers: klimek, LegalizeAdulthood, alexfh Subscribers: cfe-commits, alexfh Differential Revision: http://reviews.llvm.org/D14204 llvm-svn: 251792
* [tidy] Remove stray iostream include from test.Benjamin Kramer2015-10-281-1/+1
| | | | | | | It is unused and we cannot rely on standard headers being present while executing tests. llvm-svn: 251499
* Add modernize-redundant-void-arg check to clang-tidyAlexander Kornienko2015-10-281-0/+419
This check for clang-tidy looks for function with zero arguments declared as (void) and removes the unnecessary void token. int foo(void); becomes int foo(); The check performs no formatting of the surrounding context but uses the lexer to look for the token sequence "(", "void", ")" in the prototype text. If this sequence of tokens is found, a removal is issued for the void token only. Patch by Richard Thomson! (+fixed tests, moved the check to the modernize module) Differential revision: http://reviews.llvm.org/D7639 llvm-svn: 251475
OpenPOWER on IntegriCloud