aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Sema/incompatible-sign.cpp
blob: 6ad1466ba9e487843933a818c2bf7603d0c97200 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// RUN: %clang_cc1 %s -verify -fsyntax-only
// RUN: %clang_cc1 %s -verify -fsyntax-only -fno-signed-char

void plainToSigned() {
  extern char c;
  signed char *p;
  p = &c; // expected-error {{converts between pointers to integer types where one is of the unique plain 'char' type and the other is not}}
}

void unsignedToPlain() {
  extern unsigned char uc;
  char *p;
  p = &uc; // expected-error {{converts between pointers to integer types where one is of the unique plain 'char' type and the other is not}}
}