diff options
-rw-r--r-- | AST/Type.cpp | 3 | ||||
-rw-r--r-- | test/Sema/complex-int.c | 10 |
2 files changed, 13 insertions, 0 deletions
diff --git a/AST/Type.cpp b/AST/Type.cpp index 610cd8fcab..949b6f8d2a 100644 --- a/AST/Type.cpp +++ b/AST/Type.cpp @@ -310,6 +310,9 @@ bool Type::isIntegerType() const { if (const TagType *TT = dyn_cast<TagType>(CanonicalType)) if (TT->getDecl()->getKind() == Decl::Enum) return true; + // Check for GCC complex integer extension. + if (const ComplexType *CT = dyn_cast<ComplexType>(CanonicalType)) + return CT->getElementType()->isIntegerType(); if (const VectorType *VT = dyn_cast<VectorType>(CanonicalType)) return VT->getElementType()->isIntegerType(); return false; diff --git a/test/Sema/complex-int.c b/test/Sema/complex-int.c new file mode 100644 index 0000000000..f0c29a94d3 --- /dev/null +++ b/test/Sema/complex-int.c @@ -0,0 +1,10 @@ +// RUN: clang %s -verify -fsyntax-only + +void a() { +__complex__ int arr; +__complex__ short brr; +__complex__ int result; + +result = arr*brr; +} + |