diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-01-19 19:26:10 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-01-19 19:26:10 +0000 |
commit | dd430f7ec9511f440a55d090c1a8d4df118e0e68 (patch) | |
tree | 7b670938f8911ad43483817101a0f90454211517 /clang/test/Sema/pointer-addition.c | |
parent | ababe7d47df60f0a68b3a3712de4032e1a12d3fb (diff) | |
download | bcm5719-llvm-dd430f7ec9511f440a55d090c1a8d4df118e0e68.tar.gz bcm5719-llvm-dd430f7ec9511f440a55d090c1a8d4df118e0e68.zip |
Centralize error reporting of improper uses of incomplete types in the
new DiagnoseIncompleteType. It provides additional information about
struct/class/union/enum types when possible, either by pointing to the
forward declaration of that type or by pointing to the definition (if
we're in the process of defining that type).
Fixes <rdar://problem/6500531>.
llvm-svn: 62521
Diffstat (limited to 'clang/test/Sema/pointer-addition.c')
-rw-r--r-- | clang/test/Sema/pointer-addition.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/test/Sema/pointer-addition.c b/clang/test/Sema/pointer-addition.c index f2fb973d1be..95f364fc676 100644 --- a/clang/test/Sema/pointer-addition.c +++ b/clang/test/Sema/pointer-addition.c @@ -1,6 +1,6 @@ // RUN: clang %s -fsyntax-only -verify -pedantic -typedef struct S S; +typedef struct S S; // expected-note{{forward declaration of 'struct S'}} void a(S* b, void* c) { b++; // expected-error {{arithmetic on pointer to incomplete type}} b += 1; // expected-error {{arithmetic on pointer to incomplete type}} @@ -9,6 +9,6 @@ void a(S* b, void* c) { b = 1+b; // expected-error {{arithmetic on pointer to incomplete type}} /* The next couple tests are only pedantic warnings in gcc */ void (*d)(S*,void*) = a; - d += 1; // expected-error {{pointer to incomplete type}} - d++; // expected-error {{pointer to incomplete type}} + d += 1; // expected-error {{arithmetic on pointer to function type}}} + d++; // expected-error {{arithmetic on pointer to function type}}} } |