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 | 08f196716775e3b5a5406b588f5f01a0169a8a5b (patch) | |
tree | 88b73c57cd5462859b78066abb91acae9086ad92 /test/Sema/conditional-expr.c | |
parent | d880c1829395f55129fee31e2df542a475ec3cd7 (diff) |
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!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45933 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/conditional-expr.c')
-rw-r--r-- | test/Sema/conditional-expr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/Sema/conditional-expr.c b/test/Sema/conditional-expr.c index f6b9d1f42d..87fe2d2ed6 100644 --- a/test/Sema/conditional-expr.c +++ b/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; |