2 /* { dg-do compile } */
3 /* { dg-options "-Wpointer-compare" } */
4 /* { dg-additional-options "-std=c++03" { target c++ } } */
11 r
+= p
== '\0'; /* { dg-warning "comparison between pointer and zero character" } */
12 r
+= p
== L
'\0'; /* { dg-warning "comparison between pointer and zero character" } */
13 r
+= p
!= '\0'; /* { dg-warning "comparison between pointer and zero character" } */
14 r
+= p
!= L
'\0'; /* { dg-warning "comparison between pointer and zero character" } */
16 r
+= '\0' == p
; /* { dg-warning "comparison between pointer and zero character" } */
17 r
+= L
'\0' == p
; /* { dg-warning "comparison between pointer and zero character" } */
18 r
+= '\0' != p
; /* { dg-warning "comparison between pointer and zero character" } */
19 r
+= L
'\0' != p
; /* { dg-warning "comparison between pointer and zero character" } */
21 r
+= q
== '\0'; /* { dg-warning "comparison between pointer and zero character" } */
22 r
+= q
== L
'\0'; /* { dg-warning "comparison between pointer and zero character" } */
23 r
+= q
!= '\0'; /* { dg-warning "comparison between pointer and zero character" } */
24 r
+= q
!= L
'\0'; /* { dg-warning "comparison between pointer and zero character" } */
26 r
+= '\0' == q
; /* { dg-warning "comparison between pointer and zero character" } */
27 r
+= L
'\0' == q
; /* { dg-warning "comparison between pointer and zero character" } */
28 r
+= '\0' != q
; /* { dg-warning "comparison between pointer and zero character" } */
29 r
+= L
'\0' != q
; /* { dg-warning "comparison between pointer and zero character" } */
58 r
+= p
== (char) 0; /* { dg-warning "comparison between pointer and zero character" } */
59 r
+= p
!= (char) 0; /* { dg-warning "comparison between pointer and zero character" } */
61 r
+= (char) 0 == p
; /* { dg-warning "comparison between pointer and zero character" } */
62 r
+= (char) 0 != p
; /* { dg-warning "comparison between pointer and zero character" } */