Daily bump.
[gcc.git] / gcc / testsuite / g++.dg / warn / Wconversion-null-4.C
blob465dc5a14ea54ba57fd8879360f3c08bab5a783c
1 // { dg-do compile  }
2 // { dg-options "-Wconversion-null -fdiagnostics-show-caret" }
4 #include <stddef.h>
6 void callee_1 (int, int, int) {} // { dg-message "declared here" }
8 void caller_1 (void)
10   callee_1 (0, NULL, 2); // { dg-warning "passing NULL to non-pointer argument 2 of" }
11   /* { dg-begin-multiline-output "" }
12    callee_1 (0, NULL, 2);
13                 ^~~~
14      { dg-end-multiline-output "" } */
15   /* { dg-begin-multiline-output "" }
16  void callee_1 (int, int, int) {}
17                      ^~~
18      { dg-end-multiline-output "" } */
21 void callee_2 (int, void *, int) {} // { dg-message "declared here" "" { target { ! c++11 } } }
22 // { dg-message "initializing argument 2 of " "" { target c++11 } .-1 }
24 void caller_2 (void)
26   callee_2 (0, false, 2); // { dg-warning "converting 'false' to pointer type for argument 2 of " "" { target { ! c++11 } } }
27   // { dg-error "cannot convert" "" { target c++11 } .-1 }
29   /* { dg-begin-multiline-output "" }
30    callee_2 (0, false, 2);
31                 ^~~~~
32      { dg-end-multiline-output "" { target { ! c++11 } } } */
33   /* { dg-begin-multiline-output "" }
34    callee_2 (0, false, 2);
35                 ^~~~~
36                 |
37                 bool
38      { dg-end-multiline-output "" { target c++11 } } */
39   /* { dg-begin-multiline-output "" }
40  void callee_2 (int, void *, int) {}
41                      ^~~~~~
42      { dg-end-multiline-output "" } */