Mercurial > hg > CbC > CbC_llvm
comparison clang/test/SemaObjC/signed-char-bool-conversion.m @ 207:2e18cbf3894f
LLVM12
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 08 Jun 2021 06:07:14 +0900 |
parents | 0572611fdcc8 |
children | c4bab56944e8 |
comparison
equal
deleted
inserted
replaced
173:0572611fdcc8 | 207:2e18cbf3894f |
---|---|
106 int main() { | 106 int main() { |
107 f<char>(); | 107 f<char>(); |
108 f<short>(); // expected-note {{in instantiation of function template specialization 'f<short>' requested here}} | 108 f<short>(); // expected-note {{in instantiation of function template specialization 'f<short>' requested here}} |
109 } | 109 } |
110 #endif | 110 #endif |
111 | |
112 void t5(BOOL b) { | |
113 int i; | |
114 b = b ?: YES; // no warning | |
115 b = b ?: i; // expected-warning {{implicit conversion from integral type 'int' to 'BOOL'}} | |
116 b = (b = i) // expected-warning {{implicit conversion from integral type 'int' to 'BOOL'}} | |
117 ?: YES; | |
118 b = (1 ? YES : i) ?: YES; // expected-warning {{implicit conversion from integral type 'int' to 'BOOL'}} | |
119 b = b ?: (1 ? i : i); // expected-warning 2 {{implicit conversion from integral type 'int' to 'BOOL'}} | |
120 | |
121 b = b ? YES : (i ?: 0); // expected-warning {{implicit conversion from integral type 'int' to 'BOOL'}} | |
122 } |