xref: /aosp_15_r20/external/clang/test/Misc/error-limit-multiple-notes.cpp (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: not %clang_cc1 -ferror-limit 1 -fsyntax-only %s 2>&1 | FileCheck %s
2*67e74705SXin Li 
3*67e74705SXin Li // error and three notes emitted
4*67e74705SXin Li void foo(int);
5*67e74705SXin Li void foo(double);
6*67e74705SXin Li void foo(int, int);
7*67e74705SXin Li void foo(int, int, int, int);
8*67e74705SXin Li 
main()9*67e74705SXin Li int main()
10*67e74705SXin Li {
11*67e74705SXin Li     foo(1, 2, 3);
12*67e74705SXin Li }
13*67e74705SXin Li 
14*67e74705SXin Li // error and note suppressed by error-limit
15*67e74705SXin Li struct s1{};
16*67e74705SXin Li struct s1{};
17*67e74705SXin Li 
18*67e74705SXin Li // CHECK: 11:5: error: no matching function for call to 'foo'
19*67e74705SXin Li // CHECK: 6:6: note: candidate function not viable: requires 2 arguments, but 3 were provided
20*67e74705SXin Li // CHECK: 7:6: note: candidate function not viable: requires 4 arguments, but 3 were provided
21*67e74705SXin Li // CHECK: 5:6: note: candidate function not viable: requires 1 argument, but 3 were provided
22*67e74705SXin Li // CHECK: 4:6: note: candidate function not viable: requires 1 argument, but 3 were provided
23*67e74705SXin Li // CHECK: fatal error: too many errors emitted, stopping now
24*67e74705SXin Li // CHECK-NOT: 16:8: error: redefinition of 's1'
25*67e74705SXin Li // CHECK-NOT: 15:8: note: previous definition is here
26