summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjC/sizeof-interface.m
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-06-27 08:02:19 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-06-27 08:02:19 +0000
commitc93322182615e2333e85ff21d8a93b2e4fce1e3d (patch)
tree3628201f819d00bbce177993fb02fcc1b6f207ed /clang/test/SemaObjC/sizeof-interface.m
parenta61df3f843f3ec49fb6952a5a4cf94c0938307a4 (diff)
downloadbcm5719-llvm-c93322182615e2333e85ff21d8a93b2e4fce1e3d.tar.gz
bcm5719-llvm-c93322182615e2333e85ff21d8a93b2e4fce1e3d.zip
Factor out (some of) the checking for invalid forms of pointer
arithmetic into a couple of common routines. Use these to make the messages more consistent in the various contexts, especially in terms of consistently diagnosing binary operators with invalid types on both the left- and right-hand side. Also, improve the grammar and wording of the messages some, handling both two pointers and two (different) types. The wording of function pointer arithmetic diagnostics still strikes me as poorly phrased, and I worry this makes them slightly more awkward if more consistent. I'm hoping to fix that with a follow-on patch and test case that will also make them more helpful when a typedef or template type parameter makes the type completely opaque. Suggestions on better wording are very welcome, thanks to Richard Smith for some initial help on that front. llvm-svn: 133906
Diffstat (limited to 'clang/test/SemaObjC/sizeof-interface.m')
-rw-r--r--clang/test/SemaObjC/sizeof-interface.m2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/SemaObjC/sizeof-interface.m b/clang/test/SemaObjC/sizeof-interface.m
index 3fe39645fdd..65c8e49e0b8 100644
--- a/clang/test/SemaObjC/sizeof-interface.m
+++ b/clang/test/SemaObjC/sizeof-interface.m
@@ -7,7 +7,7 @@ int g0 = sizeof(I0); // expected-error{{invalid application of 'sizeof' to an in
// rdar://6821047
void *g3(I0 *P) {
- P = P+5; // expected-error {{arithmetic on pointer to incomplete type 'I0 *'}}
+ P = P+5; // expected-error {{arithmetic on a pointer to an incomplete type 'I0'}}
return &P[4]; // expected-error{{subscript of pointer to incomplete type 'I0'}}
}
OpenPOWER on IntegriCloud