summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/const-eval.c
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-11-13 00:03:19 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-11-13 00:03:19 +0000
commitc7ec5fcf24308e6151845e9c3e8740f7c8682e06 (patch)
tree8e2915241387c68e0422712972ab9aa0d51d578c /clang/test/Sema/const-eval.c
parente9c16a6a7939001b3cf1758335c4c4cf5277ebe4 (diff)
downloadbcm5719-llvm-c7ec5fcf24308e6151845e9c3e8740f7c8682e06.tar.gz
bcm5719-llvm-c7ec5fcf24308e6151845e9c3e8740f7c8682e06.zip
Fix bug in constant evaluation exposed by 176.gcc.
- Evaluation of , operator used bogus assumption that LHS could be evaluated as an integral expression even though its type is unspecified. This change is making isICE very permissive of the LHS in non-evaluated contexts because it is not clear what predicate we would use to reject code here. The standard didn't offer me any guidance; opinions? llvm-svn: 59196
Diffstat (limited to 'clang/test/Sema/const-eval.c')
-rw-r--r--clang/test/Sema/const-eval.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/test/Sema/const-eval.c b/clang/test/Sema/const-eval.c
index f42ed2504b1..c808b4818f7 100644
--- a/clang/test/Sema/const-eval.c
+++ b/clang/test/Sema/const-eval.c
@@ -11,3 +11,5 @@ struct y {int x,y;};
EVAL_EXPR(6, (int)(1+(struct y*)0))
EVAL_EXPR(7, (int)&((struct y*)0)->y)
EVAL_EXPR(8, (_Bool)"asdf")
+void g0(void);
+EVAL_EXPR(9, (g0(), 12)) // expected-error {{fields must have a constant size}}
OpenPOWER on IntegriCloud