diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-01-08 21:12:04 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-01-08 21:12:04 +0000 |
| commit | a12bf9106a70841f96c7105ef663a1af5f45989a (patch) | |
| tree | e4e47a31165b07b5d3d400eb9307d557102eb6d2 /clang/test | |
| parent | 215284d089dd0956f684daf10f245b1a31c14aed (diff) | |
| download | bcm5719-llvm-a12bf9106a70841f96c7105ef663a1af5f45989a.tar.gz bcm5719-llvm-a12bf9106a70841f96c7105ef663a1af5f45989a.zip | |
Factor out comparison handling for arithmetic types.
This is not quite NFC: we don't perform the usual arithmetic conversions unless
we have an operand of arithmetic or enumeration type any more. This matches the
standard rule, but actually has no effect other than to marginally improve our
diagnostics for the non-arithmetic, non-enumeration cases (by not performing
integral promotions on one operand if the other is a pointer).
llvm-svn: 322024
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Parser/pointer_promotion.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/Parser/pointer_promotion.c b/clang/test/Parser/pointer_promotion.c index 30589d01326..8b718ad565c 100644 --- a/clang/test/Parser/pointer_promotion.c +++ b/clang/test/Parser/pointer_promotion.c @@ -12,6 +12,6 @@ void test() { if (cp < fp) {} // expected-warning {{comparison of distinct pointer types ('char *' and 'struct foo *')}} if (fp < bp) {} // expected-warning {{comparison of distinct pointer types ('struct foo *' and 'struct bar *')}} if (ip < 7) {} // expected-warning {{comparison between pointer and integer ('int *' and 'int')}} - if (sint < ip) {} // expected-warning {{comparison between pointer and integer ('int' and 'int *')}} + if (sint < ip) {} // expected-warning {{comparison between pointer and integer ('short' and 'int *')}} if (ip == cp) {} // expected-warning {{comparison of distinct pointer types ('int *' and 'char *')}} } |

