summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/pointer-subtract-compat.c
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/Sema/pointer-subtract-compat.c
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/Sema/pointer-subtract-compat.c')
-rw-r--r--clang/test/Sema/pointer-subtract-compat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/Sema/pointer-subtract-compat.c b/clang/test/Sema/pointer-subtract-compat.c
index 70340c6a4cd..b801f81473b 100644
--- a/clang/test/Sema/pointer-subtract-compat.c
+++ b/clang/test/Sema/pointer-subtract-compat.c
@@ -7,5 +7,5 @@ int a(char* a, rchar* b) {
// <rdar://problem/6520707>
void f0(void (*fp)(void)) {
- int x = fp - fp; // expected-warning{{arithmetic on pointer to function type 'void (*)(void)' is a GNU extension}}
+ int x = fp - fp; // expected-warning{{arithmetic on pointers to the function type 'void (void)' is a GNU extension}}
}
OpenPOWER on IntegriCloud