]> granicus.if.org Git - clang/commitdiff
Remove a FIXME, allowing ++/-- on Complex types (a GCC extension).
authorSteve Naroff <snaroff@apple.com>
Thu, 23 Aug 2007 21:37:33 +0000 (21:37 +0000)
committerSteve Naroff <snaroff@apple.com>
Thu, 23 Aug 2007 21:37:33 +0000 (21:37 +0000)
Now, the following test case succeeds...

_Complex double x, y;
void test2(int c) {
  ++x;
}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41335 91177308-0d34-0410-b5e6-96231b3b80d8

Sema/SemaExpr.cpp

index 7fc6422ab7bb82134ce9bb1631bb5944e8e6a12d..6d5d8527191d0cb21505c381f57f3fc2c4bbc7d8 100644 (file)
@@ -1262,14 +1262,14 @@ QualType Sema::CheckIncrementDecrementOperand(Expr *op, SourceLocation OpLoc) {
            resType.getAsString(), op->getSourceRange());
       return QualType();
     }
-  } else if (!resType->isRealType()) { 
-    // FIXME: Allow Complex as a GCC extension.
+  } else if (!resType->isRealType() && !resType->isComplexType()) { 
+    // Allowing Complex is a GCC extension.
     Diag(OpLoc, diag::err_typecheck_illegal_increment_decrement,
          resType.getAsString(), op->getSourceRange());
     return QualType(); 
   }
-  // At this point, we know we have a real or pointer type. Now make sure
-  // the operand is a modifiable lvalue.
+  // At this point, we know we have a real, complex or pointer type. 
+  // Now make sure the operand is a modifiable lvalue.
   Expr::isModifiableLvalueResult mlval = op->isModifiableLvalue();
   if (mlval != Expr::MLV_Valid) {
     // FIXME: emit a more precise diagnostic...