aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-03-24 20:13:58 +0000
committerDouglas Gregor <dgregor@apple.com>2009-03-24 20:13:58 +0000
commit8dcb29db8483d4dcaeeecc0e653b642b0a41cd2c (patch)
tree75e7a84f6aacdd9080f870653b65f619b171f4a4 /lib/Sema/SemaExpr.cpp
parente7450f5dbd5bed63b8ef9db86350a8fc3db011e8 (diff)
Fix a few isObjectTypes that really need to be isIncompleteOrObject
types; add another use of RequireCompleteType. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67644 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 03d8501245..d2972caff7 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -3752,9 +3752,7 @@ QualType Sema::CheckIncrementDecrementOperand(Expr *Op, SourceLocation OpLoc,
// OK!
} else if (const PointerType *PT = ResType->getAsPointerType()) {
// C99 6.5.2.4p2, 6.5.6p2
- if (PT->getPointeeType()->isObjectType()) {
- // Pointer to object is ok!
- } else if (PT->getPointeeType()->isVoidType()) {
+ if (PT->getPointeeType()->isVoidType()) {
if (getLangOptions().CPlusPlus) {
Diag(OpLoc, diag::err_typecheck_pointer_arith_void_type)
<< Op->getSourceRange();
@@ -3772,13 +3770,11 @@ QualType Sema::CheckIncrementDecrementOperand(Expr *Op, SourceLocation OpLoc,
Diag(OpLoc, diag::ext_gnu_ptr_func_arith)
<< ResType << Op->getSourceRange();
- } else {
- RequireCompleteType(OpLoc, PT->getPointeeType(),
- diag::err_typecheck_arithmetic_incomplete_type,
- Op->getSourceRange(), SourceRange(),
- ResType);
+ } else if (RequireCompleteType(OpLoc, PT->getPointeeType(),
+ diag::err_typecheck_arithmetic_incomplete_type,
+ Op->getSourceRange(), SourceRange(),
+ ResType))
return QualType();
- }
} else if (ResType->isComplexType()) {
// C99 does not support ++/-- on complex types, we allow as an extension.
Diag(OpLoc, diag::ext_integer_increment_complex)