brintos

brintos / llvm-project-archived public Read only

0
0
Text · 885 B · 4e05ada Raw
29 lines · cpp
1// RUN: %check_clang_tidy %s modernize-redundant-void-arg %t -- -- -fdelayed-template-parsing2 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