diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2009-05-03 22:36:05 +0000 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2009-05-03 22:36:05 +0000 |
| commit | b8c4fd8cfd27dbc63e1706729be4b330bf946a0c (patch) | |
| tree | 49b37e6478c4351aec75ff84f6f8696af839cde3 /clang/test/Sema | |
| parent | ba49fef34a7150c74f244e6fe134830d44587998 (diff) | |
| download | bcm5719-llvm-b8c4fd8cfd27dbc63e1706729be4b330bf946a0c.tar.gz bcm5719-llvm-b8c4fd8cfd27dbc63e1706729be4b330bf946a0c.zip | |
PR2524: downgrade taking address of expression of type 'void' to an
extension warning.
llvm-svn: 70805
Diffstat (limited to 'clang/test/Sema')
| -rw-r--r-- | clang/test/Sema/deref.c | 7 | ||||
| -rw-r--r-- | clang/test/Sema/varargs.c | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/clang/test/Sema/deref.c b/clang/test/Sema/deref.c index fad56430a07..965940e26d5 100644 --- a/clang/test/Sema/deref.c +++ b/clang/test/Sema/deref.c @@ -1,4 +1,5 @@ -// RUN: clang-cc -fsyntax-only -verify -std=c90 %s +/* RUN: clang-cc -fsyntax-only -verify -std=c90 -pedantic %s + */ void foo (void) { @@ -17,7 +18,7 @@ void foo2 (void) void foo3 (void) { void* x = 0; - void* y = &*x; // expected-error{{address expression must be an lvalue or a function designator}} + void* y = &*x; /* expected-warning{{address of an expression of type 'void'}} */ } extern const void cv1; @@ -30,7 +31,7 @@ const void *foo4 (void) extern void cv2; void *foo5 (void) { - return &cv2; // expected-error{{address expression must be an lvalue or a function designator}} + return &cv2; /* expected-warning{{address of an expression of type 'void'}} */ } typedef const void CVT; diff --git a/clang/test/Sema/varargs.c b/clang/test/Sema/varargs.c index d5b4aac6f7d..8d2f0b1fa83 100644 --- a/clang/test/Sema/varargs.c +++ b/clang/test/Sema/varargs.c @@ -56,7 +56,7 @@ void f7(int a, ...) { __builtin_va_list ap; __builtin_va_start(ap, a); // FIXME: This error message is sub-par. - __builtin_va_arg(ap, int) = 1; // expected-error {{non-object type 'int' is not assignable}} + __builtin_va_arg(ap, int) = 1; // expected-error {{expression is not assignable}} int *x = &__builtin_va_arg(ap, int); // expected-error {{address expression must be an lvalue or a function designator}} __builtin_va_end(ap); } |

