summaryrefslogtreecommitdiff
path: root/test/Sema/enum-sign-conversion.c
blob: 518fc670d314611fa49e1d47db230d2df3723d74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// RUN: %clang_cc1 -triple=x86_64-pc-linux-gnu -fsyntax-only -verify -DUNSIGNED -Wsign-conversion %s
// RUN: %clang_cc1 -triple=x86_64-pc-win32 -fsyntax-only -verify -Wsign-conversion %s

// PR35200
enum X { A,B,C};
int f(enum X x) {
#ifdef UNSIGNED
  return x; // expected-warning {{implicit conversion changes signedness: 'enum X' to 'int'}}
#else
  // expected-no-diagnostics
  return x;
#endif
}