Skip to content
Commit c3ceb276 authored by Alexander Kornienko's avatar Alexander Kornienko
Browse files

Add modernize-redundant-void-arg check to clang-tidy

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
parent a1036e5d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment