summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/modernize/RedundantVoidArgCheck.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clang-tidy] Fix PR28406Alexander Kornienko2019-03-291-7/+10
| | | | | | | | 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
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | 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
* [Clang-Tidy: modernize] Fix for modernize-redundant-void-arg: complains ↵Idriss Riouak2018-09-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-4/+7
| | | | | | | | | | | | 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
* Port getLocEnd -> getEndLocStephen Kelly2018-08-091-1/+1
| | | | | | | | Subscribers: nemanjai, ioeric, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D50355 llvm-svn: 339401
* Port getLocStart -> getBeginLocStephen Kelly2018-08-091-5/+5
| | | | | | | | | | Reviewers: javed.absar Subscribers: nemanjai, kbarton, ilya-biryukov, ioeric, jkorous, arphaman, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D50354 llvm-svn: 339400
* [clang-tidy] Cleaning up language options.Gabor Horvath2016-09-241-14/+12
| | | | | | Differential Revision: https://reviews.llvm.org/D24881 llvm-svn: 282319
* [clang-tidy] Cleaning namespaces to be more consistant across checkers.Etienne Bergeron2016-05-021-3/+2
| | | | | | | | | | | | | | Summary: The goal of the patch is to bring checkers in their appropriate namespace. This path doesn't change any behavior. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19811 llvm-svn: 268264
* Add support for type aliases to modernize-redundant-void-arg.cppAaron Ballman2016-04-141-9/+13
| | | | | | Patch by Clement Courbet. llvm-svn: 266358
* Fix crashes from delayed template parsing code that assumed getBody() would ↵Aaron Ballman2016-03-221-6/+4
| | | | | | | | return non-null. Patch by Etienne Bergeron. llvm-svn: 264049
* [clang-tidy] Enhance modernize-redundant-void-arg check to apply fixes to ↵Alexander Kornienko2016-02-161-22/+10
| | | | | | | | | | | | header files Fixes http://llvm.org/PR25894 Patch by Richard Thomson! Differential revision: http://reviews.llvm.org/D16953 llvm-svn: 260948
* Fix another crash in the redundant-void-arg check.Angel Garcia Gomez2015-11-021-3/+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-10/+14
| | | | | | | | | | | | | | 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
* Add modernize-redundant-void-arg check to clang-tidyAlexander Kornienko2015-10-281-0/+254
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