1// RUN: %check_clang_tidy %s modernize-redundant-void-arg %t -- -- -fdelayed-template-parsing
2
3int foo(void) {
4// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: redundant void argument list in function definition [modernize-redundant-void-arg]
5// CHECK-FIXES: {{^}}int foo() {{{$}}
6 return 0;
7}
8
9template <class T>
10struct MyFoo {
11 int foo(void) {
12// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: redundant void argument list in function definition [modernize-redundant-void-arg]
13// CHECK-FIXES: {{^}} int foo() {{{$}}
14 return 0;
15 }
16};
17// Explicit instantiation.
18template class MyFoo<int>;
19
20template <class T>
21struct MyBar {
22 // This declaration isn't instantiated and won't be parsed 'delayed-template-parsing'.
23 int foo(void) {
24// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: redundant void argument list in function definition [modernize-redundant-void-arg]
25// CHECK-FIXES: {{^}} int foo() {{{$}}
26 return 0;
27 }
28};
29

source code of clang-tools-extra/test/clang-tidy/checkers/modernize/redundant-void-arg-delayed.cpp