diff options
author | Steve Naroff <snaroff@apple.com> | 2008-01-13 17:10:08 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2008-01-13 17:10:08 +0000 |
commit | 826e91ae04a2e78d6aa61e1e6af8ad615ea60cff (patch) | |
tree | 2efde9b3ef0acb52b398dc3e57cb04fd3bbc2087 /clang/test/Sema/conditional-expr.c | |
parent | ff70c5de69c0bf159a711015671815557b6e278d (diff) | |
download | bcm5719-llvm-826e91ae04a2e78d6aa61e1e6af8ad615ea60cff.tar.gz bcm5719-llvm-826e91ae04a2e78d6aa61e1e6af8ad615ea60cff.zip |
Change Sema::CheckAddressOfOperation() to respect C99-only addressof rules.
Remove diagnostics from Sema::CheckIndirectionOperand(). C89/C99 allow dereferencing an incomplete type. clang appears to be emulating some incorrect gcc behavior (see below).
void
foo (void)
{
struct b;
struct b* x = 0;
struct b* y = &*x; // gcc produces an error ("dereferencing pointer to incomplete type")
}
With this patch, the above is now allowed.
Bug/Patch by Eli Friedman!
llvm-svn: 45933
Diffstat (limited to 'clang/test/Sema/conditional-expr.c')
-rw-r--r-- | clang/test/Sema/conditional-expr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/Sema/conditional-expr.c b/clang/test/Sema/conditional-expr.c index f6b9d1f42da..87fe2d2ed66 100644 --- a/clang/test/Sema/conditional-expr.c +++ b/clang/test/Sema/conditional-expr.c @@ -1,7 +1,7 @@ // RUN: clang -fsyntax-only -verify -pedantic %s void foo() { *(0 ? (double *)0 : (void *)0) = 0; - *((void *) 0) = 0; // -expected-warning {{dereferencing void pointer}} -expected-error {{incomplete type 'void' is not assignable}} + *((void *) 0) = 0; // -expected-error {{incomplete type 'void' is not assignable}} double *dp; int *ip; void *vp; |