Rework commit r45976, which was incorrect.
- Add Type::isComplexIntegerType(), Type::getAsComplexIntegerType().
- Don't inlude complex types with Type::isIntegerType(), which is too general.
- Use the new predicates in Sema::UsualArithmeticConversions() to recognize/convert the types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45992 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/complex-int.c b/test/Sema/complex-int.c
index b2555f5..90d1e3d 100644
--- a/test/Sema/complex-int.c
+++ b/test/Sema/complex-int.c
@@ -5,10 +5,18 @@
__complex__ short brr;
__complex__ unsigned xx;
__complex__ signed yy;
-
__complex__ int result;
+int ii;
+
+result = arr*ii;
+result = ii*brr;
result = arr*brr;
result = xx*yy;
+
+switch (arr) { // expected-error{{statement requires expression of integer type ('_Complex int' invalid)}}
+ case brr: ; // expected-error{{case label does not reduce to an integer constant}}
+ case xx: ; // expected-error{{case label does not reduce to an integer constant}}
+}
}