Re: [clang-tools-extra] r342388 - [Clang-Tidy: modernize] Fix for modernize-redundant-void-arg: complains about variable cast to void

2018-09-18 Thread Alexander Kornienko via cfe-commits
Nope, that's fine. See my previous email.

On Mon, Sep 17, 2018 at 3:18 PM IdrissRio 
wrote:

> Yes I have already make the fix commit. It was an error in the  tests.
>
>
> https://github.com/llvm-mirror/clang-tools-extra/commit/77ed1cd838a249d6134de9a6bdbe17ef46ecf946
>
>
> Now on my Mac it compile and all the tests are ok.
> Should I try anything else ?
>
> Il giorno 17 set 2018, alle ore 15:14, Alexander Kornienko via cfe-commits
>  ha scritto:
>
> It looks like this commit breaks buildbots (e.g.
> http://lab.llvm.org:8011/builders/clang-cmake-armv8-quick/builds/6711).
> Could you take a look?
>
> On Mon, Sep 17, 2018 at 2:33 PM Idriss Riouak via cfe-commits <
> cfe-commits@lists.llvm.org> wrote:
>
>> Author: idrissrio
>> Date: Mon Sep 17 05:29:29 2018
>> New Revision: 342388
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=342388=rev
>> Log:
>> [Clang-Tidy: modernize] Fix for modernize-redundant-void-arg: complains
>> 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 
>> struct S {
>>   template 
>>   void g() const {
>> int a;
>> (void)a;
>>   }
>> };
>>
>> void f() {
>>   S().g();
>> }
>> ```
>>
>>
>> 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
>>
>> Modified:
>> clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp
>>
>> clang-tools-extra/trunk/test/clang-tidy/modernize-redundant-void-arg.cpp
>>
>> Modified:
>> clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp?rev=342388=342387=342388=diff
>>
>> ==
>> ---
>> clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp
>> (original)
>> +++
>> clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp Mon
>> Sep 17 05:29:29 2018
>> @@ -49,7 +49,7 @@ void RedundantVoidArgCheck::registerMatc
>>  return;
>>
>>Finder->addMatcher(functionDecl(parameterCountIs(0),
>> unless(isImplicit()),
>> -  unless(isExternC()))
>> +  unless(isInstantiated()),
>> unless(isExternC()))
>>   .bind(FunctionId),
>>   this);
>>Finder->addMatcher(typedefNameDecl().bind(TypedefId), this);
>>
>> Modified:
>> clang-tools-extra/trunk/test/clang-tidy/modernize-redundant-void-arg.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/modernize-redundant-void-arg.cpp?rev=342388=342387=342388=diff
>>
>> ==
>> ---
>> clang-tools-extra/trunk/test/clang-tidy/modernize-redundant-void-arg.cpp
>> (original)
>> +++
>> clang-tools-extra/trunk/test/clang-tidy/modernize-redundant-void-arg.cpp
>> Mon Sep 17 05:29:29 2018
>> @@ -488,3 +488,64 @@ void lambda_expression_with_macro_test()
>>// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: redundant void argument
>> list in lambda expression [modernize-redundant-void-arg]
>>// CHECK-FIXES: []() BODY;
>>  }
>> +
>> +struct S_1 {
>> +  void g_1(void) const {
>> +// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: redundant void argument
>> list in function definition [modernize-redundant-void-arg]
>> +// CHECK-FIXES: void g_1() const {
>> +int a;
>> +(void)a;
>> +  }
>> +
>> +  void g_2() const {
>> +int a;
>> +(void)a;
>> +  }
>> +};
>> +
>> +template 
>> +struct S_2 {
>> +  void g_1(void) const {
>> +// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: redundant void argument
>> list in function definition [modernize-redundant-void-arg]
>> +// CHECK-FIXES: void g_1() const {
>> +int a;
>> +(void)a;
>> +  }
>> +
>> +  void g_2() const {
>> +int a;
>> +(void)a;
>> +  }
>> +};
>> +
>> +template 
>> +struct S_3 {
>> +  template 
>> +  void g_1(void) const {
>> +// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: redundant void argument
>> list in function definition [modernize-redundant-void-arg]
>> +// CHECK-FIXES: void g_1() const {
>> +   

Re: [clang-tools-extra] r342388 - [Clang-Tidy: modernize] Fix for modernize-redundant-void-arg: complains about variable cast to void

2018-09-17 Thread IdrissRio via cfe-commits
Yes I have already make the fix commit. It was an error in the  tests. 

https://github.com/llvm-mirror/clang-tools-extra/commit/77ed1cd838a249d6134de9a6bdbe17ef46ecf946
 



Now on my Mac it compile and all the tests are ok. 
Should I try anything else ?

> Il giorno 17 set 2018, alle ore 15:14, Alexander Kornienko via cfe-commits 
> mailto:cfe-commits@lists.llvm.org>> ha scritto:
> 
> It looks like this commit breaks buildbots (e.g. 
> http://lab.llvm.org:8011/builders/clang-cmake-armv8-quick/builds/6711 
> ). 
> Could you take a look?
> 
> On Mon, Sep 17, 2018 at 2:33 PM Idriss Riouak via cfe-commits 
> mailto:cfe-commits@lists.llvm.org>> wrote:
> Author: idrissrio
> Date: Mon Sep 17 05:29:29 2018
> New Revision: 342388
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=342388=rev 
> 
> Log:
> [Clang-Tidy: modernize] Fix for modernize-redundant-void-arg: complains 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 
> struct S {
>   template 
>   void g() const {
> int a;
> (void)a;
>   }
> };
> 
> void f() {
>   S().g();
> }
> ```
> 
> 
> 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 
> 
> 
> Modified:
> clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp
> clang-tools-extra/trunk/test/clang-tidy/modernize-redundant-void-arg.cpp
> 
> Modified: 
> clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp?rev=342388=342387=342388=diff
>  
> 
> ==
> --- clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp 
> (original)
> +++ clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp 
> Mon Sep 17 05:29:29 2018
> @@ -49,7 +49,7 @@ void RedundantVoidArgCheck::registerMatc
>  return;
> 
>Finder->addMatcher(functionDecl(parameterCountIs(0), unless(isImplicit()),
> -  unless(isExternC()))
> +  unless(isInstantiated()), 
> unless(isExternC()))
>   .bind(FunctionId),
>   this);
>Finder->addMatcher(typedefNameDecl().bind(TypedefId), this);
> 
> Modified: 
> clang-tools-extra/trunk/test/clang-tidy/modernize-redundant-void-arg.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/modernize-redundant-void-arg.cpp?rev=342388=342387=342388=diff
>  
> 
> ==
> --- clang-tools-extra/trunk/test/clang-tidy/modernize-redundant-void-arg.cpp 
> (original)
> +++ clang-tools-extra/trunk/test/clang-tidy/modernize-redundant-void-arg.cpp 
> Mon Sep 17 05:29:29 2018
> @@ -488,3 +488,64 @@ void lambda_expression_with_macro_test()
>// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: redundant void argument list 
> in lambda expression [modernize-redundant-void-arg]
>// CHECK-FIXES: []() BODY;
>  }
> +
> +struct S_1 {
> +  void g_1(void) const {
> +// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: redundant void argument 
> list in function definition [modernize-redundant-void-arg]
> +// CHECK-FIXES: void g_1() const {
> +int a;
> +(void)a;
> +  }
> +
> +  void g_2() const {
> +int a;
> +(void)a;
> +  }
> +};
> +
> +template 
> +struct S_2 {
> +  void g_1(void) const {
> +// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: redundant void argument 
> list in function definition 

Re: [clang-tools-extra] r342388 - [Clang-Tidy: modernize] Fix for modernize-redundant-void-arg: complains about variable cast to void

2018-09-17 Thread Alexander Kornienko via cfe-commits
Ah, now I see your fix in r342389. Thanks!

On Mon, Sep 17, 2018 at 3:15 PM Alexander Kornienko 
wrote:

> (If there's no clear idea of how to fix this, reverting until the fix is
> found is usually the best strategy.)
>
> On Mon, Sep 17, 2018 at 3:14 PM Alexander Kornienko 
> wrote:
>
>> It looks like this commit breaks buildbots (e.g.
>> http://lab.llvm.org:8011/builders/clang-cmake-armv8-quick/builds/6711).
>> Could you take a look?
>>
>> On Mon, Sep 17, 2018 at 2:33 PM Idriss Riouak via cfe-commits <
>> cfe-commits@lists.llvm.org> wrote:
>>
>>> Author: idrissrio
>>> Date: Mon Sep 17 05:29:29 2018
>>> New Revision: 342388
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=342388=rev
>>> Log:
>>> [Clang-Tidy: modernize] Fix for modernize-redundant-void-arg: complains
>>> 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 
>>> struct S {
>>>   template 
>>>   void g() const {
>>> int a;
>>> (void)a;
>>>   }
>>> };
>>>
>>> void f() {
>>>   S().g();
>>> }
>>> ```
>>>
>>>
>>> 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
>>>
>>> Modified:
>>>
>>> clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp
>>>
>>> clang-tools-extra/trunk/test/clang-tidy/modernize-redundant-void-arg.cpp
>>>
>>> Modified:
>>> clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp?rev=342388=342387=342388=diff
>>>
>>> ==
>>> ---
>>> clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp
>>> (original)
>>> +++
>>> clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp Mon
>>> Sep 17 05:29:29 2018
>>> @@ -49,7 +49,7 @@ void RedundantVoidArgCheck::registerMatc
>>>  return;
>>>
>>>Finder->addMatcher(functionDecl(parameterCountIs(0),
>>> unless(isImplicit()),
>>> -  unless(isExternC()))
>>> +  unless(isInstantiated()),
>>> unless(isExternC()))
>>>   .bind(FunctionId),
>>>   this);
>>>Finder->addMatcher(typedefNameDecl().bind(TypedefId), this);
>>>
>>> Modified:
>>> clang-tools-extra/trunk/test/clang-tidy/modernize-redundant-void-arg.cpp
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/modernize-redundant-void-arg.cpp?rev=342388=342387=342388=diff
>>>
>>> ==
>>> ---
>>> clang-tools-extra/trunk/test/clang-tidy/modernize-redundant-void-arg.cpp
>>> (original)
>>> +++
>>> clang-tools-extra/trunk/test/clang-tidy/modernize-redundant-void-arg.cpp
>>> Mon Sep 17 05:29:29 2018
>>> @@ -488,3 +488,64 @@ void lambda_expression_with_macro_test()
>>>// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: redundant void argument
>>> list in lambda expression [modernize-redundant-void-arg]
>>>// CHECK-FIXES: []() BODY;
>>>  }
>>> +
>>> +struct S_1 {
>>> +  void g_1(void) const {
>>> +// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: redundant void
>>> argument list in function definition [modernize-redundant-void-arg]
>>> +// CHECK-FIXES: void g_1() const {
>>> +int a;
>>> +(void)a;
>>> +  }
>>> +
>>> +  void g_2() const {
>>> +int a;
>>> +(void)a;
>>> +  }
>>> +};
>>> +
>>> +template 
>>> +struct S_2 {
>>> +  void g_1(void) const {
>>> +// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: redundant void
>>> argument list in function definition [modernize-redundant-void-arg]
>>> +// CHECK-FIXES: void g_1() const {
>>> +int a;
>>> +(void)a;
>>> +  }
>>> +
>>> +  void g_2() const {
>>> +int a;
>>> +(void)a;
>>> +  }
>>> +};
>>> +
>>> +template 
>>> +struct S_3 {
>>> +  template 
>>> +  void g_1(void) const {
>>> +// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: redundant void
>>> argument list in function definition [modernize-redundant-void-arg]
>>> +// CHECK-FIXES: void g_1() const {
>>> +int a;
>>> +   

Re: [clang-tools-extra] r342388 - [Clang-Tidy: modernize] Fix for modernize-redundant-void-arg: complains about variable cast to void

2018-09-17 Thread Alexander Kornienko via cfe-commits
(If there's no clear idea of how to fix this, reverting until the fix is
found is usually the best strategy.)

On Mon, Sep 17, 2018 at 3:14 PM Alexander Kornienko 
wrote:

> It looks like this commit breaks buildbots (e.g.
> http://lab.llvm.org:8011/builders/clang-cmake-armv8-quick/builds/6711).
> Could you take a look?
>
> On Mon, Sep 17, 2018 at 2:33 PM Idriss Riouak via cfe-commits <
> cfe-commits@lists.llvm.org> wrote:
>
>> Author: idrissrio
>> Date: Mon Sep 17 05:29:29 2018
>> New Revision: 342388
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=342388=rev
>> Log:
>> [Clang-Tidy: modernize] Fix for modernize-redundant-void-arg: complains
>> 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 
>> struct S {
>>   template 
>>   void g() const {
>> int a;
>> (void)a;
>>   }
>> };
>>
>> void f() {
>>   S().g();
>> }
>> ```
>>
>>
>> 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
>>
>> Modified:
>> clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp
>>
>> clang-tools-extra/trunk/test/clang-tidy/modernize-redundant-void-arg.cpp
>>
>> Modified:
>> clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp?rev=342388=342387=342388=diff
>>
>> ==
>> ---
>> clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp
>> (original)
>> +++
>> clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp Mon
>> Sep 17 05:29:29 2018
>> @@ -49,7 +49,7 @@ void RedundantVoidArgCheck::registerMatc
>>  return;
>>
>>Finder->addMatcher(functionDecl(parameterCountIs(0),
>> unless(isImplicit()),
>> -  unless(isExternC()))
>> +  unless(isInstantiated()),
>> unless(isExternC()))
>>   .bind(FunctionId),
>>   this);
>>Finder->addMatcher(typedefNameDecl().bind(TypedefId), this);
>>
>> Modified:
>> clang-tools-extra/trunk/test/clang-tidy/modernize-redundant-void-arg.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/modernize-redundant-void-arg.cpp?rev=342388=342387=342388=diff
>>
>> ==
>> ---
>> clang-tools-extra/trunk/test/clang-tidy/modernize-redundant-void-arg.cpp
>> (original)
>> +++
>> clang-tools-extra/trunk/test/clang-tidy/modernize-redundant-void-arg.cpp
>> Mon Sep 17 05:29:29 2018
>> @@ -488,3 +488,64 @@ void lambda_expression_with_macro_test()
>>// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: redundant void argument
>> list in lambda expression [modernize-redundant-void-arg]
>>// CHECK-FIXES: []() BODY;
>>  }
>> +
>> +struct S_1 {
>> +  void g_1(void) const {
>> +// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: redundant void argument
>> list in function definition [modernize-redundant-void-arg]
>> +// CHECK-FIXES: void g_1() const {
>> +int a;
>> +(void)a;
>> +  }
>> +
>> +  void g_2() const {
>> +int a;
>> +(void)a;
>> +  }
>> +};
>> +
>> +template 
>> +struct S_2 {
>> +  void g_1(void) const {
>> +// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: redundant void argument
>> list in function definition [modernize-redundant-void-arg]
>> +// CHECK-FIXES: void g_1() const {
>> +int a;
>> +(void)a;
>> +  }
>> +
>> +  void g_2() const {
>> +int a;
>> +(void)a;
>> +  }
>> +};
>> +
>> +template 
>> +struct S_3 {
>> +  template 
>> +  void g_1(void) const {
>> +// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: redundant void argument
>> list in function definition [modernize-redundant-void-arg]
>> +// CHECK-FIXES: void g_1() const {
>> +int a;
>> +(void)a;
>> +  }
>> +  template 
>> +  void g_2() const {
>> +int a;
>> +(void)a;
>> +  }
>> +};
>> +
>> +template 
>> +void g_3(void) {
>> +  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: redundant void argument
>> list in function definition 

Re: [clang-tools-extra] r342388 - [Clang-Tidy: modernize] Fix for modernize-redundant-void-arg: complains about variable cast to void

2018-09-17 Thread Alexander Kornienko via cfe-commits
It looks like this commit breaks buildbots (e.g.
http://lab.llvm.org:8011/builders/clang-cmake-armv8-quick/builds/6711).
Could you take a look?

On Mon, Sep 17, 2018 at 2:33 PM Idriss Riouak via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: idrissrio
> Date: Mon Sep 17 05:29:29 2018
> New Revision: 342388
>
> URL: http://llvm.org/viewvc/llvm-project?rev=342388=rev
> Log:
> [Clang-Tidy: modernize] Fix for modernize-redundant-void-arg: complains
> 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 
> struct S {
>   template 
>   void g() const {
> int a;
> (void)a;
>   }
> };
>
> void f() {
>   S().g();
> }
> ```
>
>
> 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
>
> Modified:
> clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp
>
> clang-tools-extra/trunk/test/clang-tidy/modernize-redundant-void-arg.cpp
>
> Modified:
> clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp?rev=342388=342387=342388=diff
>
> ==
> --- clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp
> (original)
> +++ clang-tools-extra/trunk/clang-tidy/modernize/RedundantVoidArgCheck.cpp
> Mon Sep 17 05:29:29 2018
> @@ -49,7 +49,7 @@ void RedundantVoidArgCheck::registerMatc
>  return;
>
>Finder->addMatcher(functionDecl(parameterCountIs(0),
> unless(isImplicit()),
> -  unless(isExternC()))
> +  unless(isInstantiated()),
> unless(isExternC()))
>   .bind(FunctionId),
>   this);
>Finder->addMatcher(typedefNameDecl().bind(TypedefId), this);
>
> Modified:
> clang-tools-extra/trunk/test/clang-tidy/modernize-redundant-void-arg.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/modernize-redundant-void-arg.cpp?rev=342388=342387=342388=diff
>
> ==
> ---
> clang-tools-extra/trunk/test/clang-tidy/modernize-redundant-void-arg.cpp
> (original)
> +++
> clang-tools-extra/trunk/test/clang-tidy/modernize-redundant-void-arg.cpp
> Mon Sep 17 05:29:29 2018
> @@ -488,3 +488,64 @@ void lambda_expression_with_macro_test()
>// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: redundant void argument
> list in lambda expression [modernize-redundant-void-arg]
>// CHECK-FIXES: []() BODY;
>  }
> +
> +struct S_1 {
> +  void g_1(void) const {
> +// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: redundant void argument
> list in function definition [modernize-redundant-void-arg]
> +// CHECK-FIXES: void g_1() const {
> +int a;
> +(void)a;
> +  }
> +
> +  void g_2() const {
> +int a;
> +(void)a;
> +  }
> +};
> +
> +template 
> +struct S_2 {
> +  void g_1(void) const {
> +// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: redundant void argument
> list in function definition [modernize-redundant-void-arg]
> +// CHECK-FIXES: void g_1() const {
> +int a;
> +(void)a;
> +  }
> +
> +  void g_2() const {
> +int a;
> +(void)a;
> +  }
> +};
> +
> +template 
> +struct S_3 {
> +  template 
> +  void g_1(void) const {
> +// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: redundant void argument
> list in function definition [modernize-redundant-void-arg]
> +// CHECK-FIXES: void g_1() const {
> +int a;
> +(void)a;
> +  }
> +  template 
> +  void g_2() const {
> +int a;
> +(void)a;
> +  }
> +};
> +
> +template 
> +void g_3(void) {
> +  // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: redundant void argument
> list in function definition [modernize-redundant-void-arg]
> +  // CHECK-FIXES: void g_3(){
> +  int a;
> +  (void)a;
> +}
> +
> +//Template instantiation
> +void f_testTemplate() {
> +  S_1();
> +  S_2();
> +  S_3();
> +  g_3();
> +}
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
>