diff options
author | Matheus Izvekov <mizvekov@gmail.com> | 2021-10-10 15:28:37 +0200 |
---|---|---|
committer | Matheus Izvekov <mizvekov@gmail.com> | 2022-09-16 16:36:00 +0200 |
commit | 67e22983115451ef5512ad2813dd337762c52da3 (patch) | |
tree | 12fd9b0474443ba095c4f67493fcc099308c4dec /clang/test/SemaObjC | |
parent | 89e4cb603d96dcb962ec76aa5e91d6ce86ffe63b (diff) | |
download | llvm-67e22983115451ef5512ad2813dd337762c52da3.zip llvm-67e22983115451ef5512ad2813dd337762c52da3.tar.gz llvm-67e22983115451ef5512ad2813dd337762c52da3.tar.bz2 |
[clang] use getCommonSugar in an assortment of places
For this patch, a simple search was performed for patterns where there are
two types (usually an LHS and an RHS) which are structurally the same, and there
is some result type which is resolved as either one of them (typically LHS for
consistency).
We change those cases to resolve as the common sugared type between those two,
utilizing the new infrastructure created for this purpose.
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Differential Revision: https://reviews.llvm.org/D111509
Diffstat (limited to 'clang/test/SemaObjC')
-rw-r--r-- | clang/test/SemaObjC/format-strings-objc.m | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/SemaObjC/format-strings-objc.m b/clang/test/SemaObjC/format-strings-objc.m index 51638f9..8eb350f 100644 --- a/clang/test/SemaObjC/format-strings-objc.m +++ b/clang/test/SemaObjC/format-strings-objc.m @@ -268,7 +268,7 @@ void testByValueObjectInFormat(Foo *obj) { // <rdar://problem/13557053> void testTypeOf(NSInteger dW, NSInteger dH) { - NSLog(@"dW %d dH %d",({ __typeof__(dW) __a = (dW); __a < 0 ? -__a : __a; }),({ __typeof__(dH) __a = (dH); __a < 0 ? -__a : __a; })); // expected-warning 2 {{format specifies type 'int' but the argument has type 'long'}} + NSLog(@"dW %d dH %d",({ __typeof__(dW) __a = (dW); __a < 0 ? -__a : __a; }),({ __typeof__(dH) __a = (dH); __a < 0 ? -__a : __a; })); // expected-warning 2 {{values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead}} } void testUnicode(void) { |