diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-05-27 15:17:06 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-05-27 15:17:06 +0000 |
commit | 53992adde3eda3ccf9da63bc7e45673f043de18f (patch) | |
tree | 3558f327a6f9ab59c5d7a06528d84e1560445247 /test/Sema/conditional-expr.c | |
parent | 7e411337c0ed226dace6e07f1420486768161308 (diff) | |
download | FreeBSD-src-53992adde3eda3ccf9da63bc7e45673f043de18f.zip FreeBSD-src-53992adde3eda3ccf9da63bc7e45673f043de18f.tar.gz |
Update clang to r104832.
Diffstat (limited to 'test/Sema/conditional-expr.c')
-rw-r--r-- | test/Sema/conditional-expr.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/Sema/conditional-expr.c b/test/Sema/conditional-expr.c index 5e2c1a4..6e248bc 100644 --- a/test/Sema/conditional-expr.c +++ b/test/Sema/conditional-expr.c @@ -52,7 +52,9 @@ void foo() { enum Enum { EVal }; test0 = test0 ? EVal : test0; test0 = test0 ? EVal : (int) test0; // okay: EVal is an int - test0 = test0 ? (unsigned) EVal : (int) test0; // expected-warning {{operands of ? are integers of different signs}} + test0 = test0 ? // expected-warning {{operands of ? are integers of different signs}} + (unsigned) EVal + : (int) test0; } int Postgresql() { @@ -68,3 +70,8 @@ int f0(int a) { // GCC considers this a warning. return a ? f1() : nil; // expected-warning {{pointer/integer type mismatch in conditional expression ('int' and 'void *')}} expected-warning {{incompatible pointer to integer conversion returning 'void *' from a function with result type 'int'}} } + +int f2(int x) { + // We can suppress this because the immediate context wants an int. + return (x != 0) ? 0U : x; +} |