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 | 6bd9719fd97abac1b8126eae866e96db88be4ac8 (patch) | |
tree | 54cdb69b17857cb8905c0c71090181f39e143f49 /test/Sema/static-init.c | |
parent | 3e9ea0b8cd7c4691d62e385245556be5fded58a7 (diff) |
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>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147026 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/static-init.c')
-rw-r--r-- | test/Sema/static-init.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/Sema/static-init.c b/test/Sema/static-init.c index b4de92713b..ec6d1e8fc0 100644 --- a/test/Sema/static-init.c +++ b/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 |