diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-12-21 00:43:02 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-12-21 00:43:02 +0000 |
commit | 13ec75ba424882b2b36169551c1cb01e609f1674 (patch) | |
tree | 4fde79832ef37c7465f843a117b8b3e76e67555e /clang/test/Sema/static-init.c | |
parent | c5af54ec899a71b7f8e3b5aa2802949581913c30 (diff) | |
download | bcm5719-llvm-13ec75ba424882b2b36169551c1cb01e609f1674.tar.gz bcm5719-llvm-13ec75ba424882b2b36169551c1cb01e609f1674.zip |
Fix a case where Expr::isConstantInitializer would return true for an expression we can't support. In a slightly amusing twist, the case in question was already in the clang regression tests marked as a valid construct. <rdar://problem/10020074>
llvm-svn: 147026
Diffstat (limited to 'clang/test/Sema/static-init.c')
-rw-r--r-- | clang/test/Sema/static-init.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/test/Sema/static-init.c b/clang/test/Sema/static-init.c index b4de92713b8..ec6d1e8fc0d 100644 --- a/clang/test/Sema/static-init.c +++ b/clang/test/Sema/static-init.c @@ -19,5 +19,6 @@ struct foo { }; union bar u[1]; -struct foo x = {(intptr_t) u}; // no-error +struct foo x = {(intptr_t) u}; // expected-error {{initializer element is not a compile-time constant}} struct foo y = {(char) u}; // expected-error {{initializer element is not a compile-time constant}} +intptr_t z = (intptr_t) u; // no-error |