xref: /llvm-project/clang/test/Sema/incompatible-sign.cpp (revision c6ffe4d76fbf6ae505c0abccaf29017414265e32)
1 // RUN: %clang_cc1 %s -verify -fsyntax-only
2 // RUN: %clang_cc1 %s -verify -fsyntax-only -fno-signed-char
3 
plainToSigned()4 void plainToSigned() {
5   extern char c;
6   signed char *p;
7   p = &c; // expected-error {{converts between pointers to integer types where one is of the unique plain 'char' type and the other is not}}
8 }
9 
unsignedToPlain()10 void unsignedToPlain() {
11   extern unsigned char uc;
12   char *p;
13   p = &uc; // expected-error {{converts between pointers to integer types where one is of the unique plain 'char' type and the other is not}}
14 }
15