Debian Codegraph @

gcc/testsuite/g++.dg/diagnostic/param-type-mismatch-3.C

raw
1 // { dg-do compile { target c++14 } }
2 // { dg-options "-fdiagnostics-show-caret" }
3
4 void f2(int, char (*)(int), int) { } // { dg-line f2 }
5
6 void test_1 ()
7 {
8 auto glambda = [](auto a) { return a; }; // { dg-line candidate }
9 int (*fp)(int) = glambda;
10 f2(1, glambda, 3); // { dg-error "invalid user-defined conversion" }
11 /* { dg-begin-multiline-output "" }
12 f2(1, glambda, 3);
13 ^~~~~~~
14 { dg-end-multiline-output "" } */
15 // { dg-message "candidate is: " "" { target *-*-* } candidate }
16 /* { dg-begin-multiline-output "" }
17 auto glambda = [](auto a) { return a; };
18 ^
19 { dg-end-multiline-output "" } */
20 // { dg-message "no known conversion from " "" { target *-*-* } candidate }
21 // { dg-message "initializing argument 2 of " "" { target *-*-* } f2 }
22 /* { dg-begin-multiline-output "" }
23 void f2(int, char (*)(int), int) { }
24 ^~~~~~~~~~~~~
25 { dg-end-multiline-output "" } */
26 }