aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExprCXX.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/SemaExprCXX.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/SemaExprCXX.cpp')
-rw-r--r--lib/Sema/SemaExprCXX.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index e2cda9dff9..a6cb24ceec 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -613,13 +613,14 @@ Sema::ActOnCXXDelete(SourceLocation StartLoc, bool UseGlobal,
<< Type << Ex->getSourceRange());
QualType Pointee = Type->getAsPointerType()->getPointeeType();
- if (!Pointee->isVoidType() &&
- RequireCompleteType(StartLoc, Pointee, diag::warn_delete_incomplete,
- Ex->getSourceRange()))
- return ExprError();
- else if (!Pointee->isObjectType())
+ if (Pointee->isFunctionType() || Pointee->isVoidType())
return ExprError(Diag(StartLoc, diag::err_delete_operand)
<< Type << Ex->getSourceRange());
+ else if (!Pointee->isDependentType() &&
+ RequireCompleteType(StartLoc, Pointee,
+ diag::warn_delete_incomplete,
+ Ex->getSourceRange()))
+ return ExprError();
// FIXME: Look up the correct operator delete overload and pass a pointer
// along.