1// RUN: %check_clang_tidy %s google-default-arguments %t
2
3struct A {
4 virtual void f(int I, int J = 3);
5 // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: default arguments on virtual or override methods are prohibited [google-default-arguments]
6};
7
8struct B : public A {
9 void f(int I, int J = 5);
10 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: default arguments on virtual or override methods are prohibited
11};
12
13struct C : public B {
14 void f(int I, int J = 5) override;
15 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: default arguments on virtual or override methods are prohibited
16};
17
18// Negatives.
19struct D : public B {
20 void f(int I, int J) override;
21};
22
23struct X {
24 void f(int I, int J = 3);
25};
26
27struct Y : public X {
28 void f(int I, int J = 5);
29};
30

source code of clang-tools-extra/test/clang-tidy/checkers/google/default-arguments.cpp