From: Steve Naroff Date: Mon, 14 Jan 2008 21:38:57 +0000 (+0000) Subject: Teach Type::isIntegerType() about GCC's __complex__ integer extensions... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3f0c5adc2f488f40aa0f7b88c27b347f80b104bb;p=clang Teach Type::isIntegerType() about GCC's __complex__ integer extensions... Bug submitted by Eli. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45976 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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(CanonicalType)) if (TT->getDecl()->getKind() == Decl::Enum) return true; + // Check for GCC complex integer extension. + if (const ComplexType *CT = dyn_cast(CanonicalType)) + return CT->getElementType()->isIntegerType(); if (const VectorType *VT = dyn_cast(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; +} +