summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/complex-init-list.c
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-01-10 04:58:17 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-01-10 04:58:17 +0000
commitc4b251dc2bc66f753f279fa904da6861093ae1e6 (patch)
tree9f2c246ca837406d87743ff79548d746bc3c4342 /clang/test/Sema/complex-init-list.c
parent1bc5c2c7efe8652f5b0599d52ad5fa2b563dfc28 (diff)
downloadbcm5719-llvm-c4b251dc2bc66f753f279fa904da6861093ae1e6.tar.gz
bcm5719-llvm-c4b251dc2bc66f753f279fa904da6861093ae1e6.zip
Implement the missing pieces of Evaluate for _Complex types. With that complete, remove some code from CGExprConstant which is no longer necessary. While I'm here, a couple minor tweaks to _Complex-in-C++. (Specifically, make _Complex types literal types, and don't warn for _Complex int.)
llvm-svn: 147840
Diffstat (limited to 'clang/test/Sema/complex-init-list.c')
-rw-r--r--clang/test/Sema/complex-init-list.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/test/Sema/complex-init-list.c b/clang/test/Sema/complex-init-list.c
index 5b5d7ce1436..bfc6899ac23 100644
--- a/clang/test/Sema/complex-init-list.c
+++ b/clang/test/Sema/complex-init-list.c
@@ -43,3 +43,6 @@ _Complex float sizetest1[] = { {1.0f, 1.0f}, {1.0f, 1.0f} }; // expected-warning
_Complex float sizecheck1[(sizeof(sizetest1) == sizeof(*sizetest1)*2) ? 1 : -1];
_Complex float sizetest2[] = { 1.0f, 1.0f, {1.0f, 1.0f} }; // expected-warning {{specifying real and imaginary components is an extension}}
_Complex float sizecheck2[(sizeof(sizetest2) == sizeof(*sizetest2)*3) ? 1 : -1];
+
+// Constant-folding with init list.
+_Complex float x = 2 + (_Complex float) { 1, 2 }; // expected-warning {{specifying real and imaginary components is an extension}}
OpenPOWER on IntegriCloud