diff options
author | Anders Carlsson <andersca@mac.com> | 2008-11-24 04:41:22 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2008-11-24 04:41:22 +0000 |
commit | a42ee44aab44a0c2094c035f3064a71ca6b2e67b (patch) | |
tree | 8ee545198a0b77e29e2801d11fb4c6791fc20e26 /clang/test | |
parent | 4c76e935074a2aef01e3560f5acc3c55d4f017ae (diff) | |
download | bcm5719-llvm-a42ee44aab44a0c2094c035f3064a71ca6b2e67b.tar.gz bcm5719-llvm-a42ee44aab44a0c2094c035f3064a71ca6b2e67b.zip |
The address of a variable is only constant if the variable has global storage.
llvm-svn: 59939
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/Sema/const-eval.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/Sema/const-eval.c b/clang/test/Sema/const-eval.c index 67c27d40f21..e3d63ca94fb 100644 --- a/clang/test/Sema/const-eval.c +++ b/clang/test/Sema/const-eval.c @@ -20,3 +20,9 @@ EVAL_EXPR(13, x || 3.0) unsigned int l_19 = 1; EVAL_EXPR(14, (1 ^ l_19) && 1); // expected-error {{fields must have a constant size}} + +void f() +{ + int a; + EVAL_EXPR(15, (_Bool)&a); // expected-error {{fields must have a constant size}} +} |