]> granicus.if.org Git - clang/commitdiff
Fix arithmetic type check
authorDouglas Gregor <dgregor@apple.com>
Thu, 30 Oct 2008 13:47:07 +0000 (13:47 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 30 Oct 2008 13:47:07 +0000 (13:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58429 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/Type.cpp

index 87b91ae2ea98c1c86929aa8c9cbc281ebdac2580..3898ba056bdd3538a5701255892e9e606c7d6efe 100644 (file)
@@ -587,7 +587,8 @@ bool Type::isRealType() const {
 
 bool Type::isArithmeticType() const {
   if (const BuiltinType *BT = dyn_cast<BuiltinType>(CanonicalType))
-    return BT->getKind() != BuiltinType::Void;
+    return BT->getKind() >= BuiltinType::Bool &&
+           BT->getKind() <= BuiltinType::LongDouble;
   if (const EnumType *ET = dyn_cast<EnumType>(CanonicalType))
     // GCC allows forward declaration of enum types (forbid by C99 6.7.2.3p2).
     // If a body isn't seen by the time we get here, return false.