diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2011-04-19 18:51:51 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2011-04-19 18:51:51 +0000 |
commit | 1c860d5640e8eebb11a5d515a761242b66761b0b (patch) | |
tree | 08f9a77fbd1e2237d1137c5d80ca402105939309 /test/Sema/expr-address-of.c | |
parent | e294ab717fc9535429ca5d8f575d41ae4441d822 (diff) |
Add a new expression classification, CL_AddressableVoid
CL_AddressableVoid is the expression classification used for void
expressions whose address can be taken, i.e. the result of [], *
or void variable references in C, as opposed to things like the
result of a void function call.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129783 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/expr-address-of.c')
-rw-r--r-- | test/Sema/expr-address-of.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Sema/expr-address-of.c b/test/Sema/expr-address-of.c index 8f9f795d00..2b8cfbfa68 100644 --- a/test/Sema/expr-address-of.c +++ b/test/Sema/expr-address-of.c @@ -107,3 +107,14 @@ char* f7() { void* t3 = &(*(void*)0); } + +void f8() { + void *dummy0 = &f8(); // expected-error {{address expression must be an lvalue or a function designator}} + + extern void v; + void *dummy1 = &(1 ? v : f8()); // expected-error {{address expression must be an lvalue or a function designator}} + + void *dummy2 = &(f8(), v); // expected-error {{address expression must be an lvalue or a function designator}} + + void *dummy3 = &({ ; }); // expected-error {{address expression must be an lvalue or a function designator}} +} |