aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaNamedCast.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2008-11-05 22:15:14 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2008-11-05 22:15:14 +0000
commit03a6cf96d8056f85803c395e938858086bedbb39 (patch)
tree6250bfcfb04ecb20054deb6722268b09998e1751 /lib/Sema/SemaNamedCast.cpp
parent26d85b197257bfa15cd8b10dfef9e741e19c4fc5 (diff)
Improve assert messages.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58770 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaNamedCast.cpp')
-rw-r--r--lib/Sema/SemaNamedCast.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/SemaNamedCast.cpp b/lib/Sema/SemaNamedCast.cpp
index f6c8cb4a3c..980e012246 100644
--- a/lib/Sema/SemaNamedCast.cpp
+++ b/lib/Sema/SemaNamedCast.cpp
@@ -216,7 +216,7 @@ Sema::CheckReinterpretCast(Expr *&SrcExpr, QualType DestType,
// Note: Clang treats enumeration types as integral types. If this is ever
// changed for C++, the additional check here will be redundant.
if (DestType->isIntegralType() && !DestType->isEnumeralType()) {
- assert(srcIsPtr);
+ assert(srcIsPtr && "One type must be a pointer");
// C++ 5.2.10p4: A pointer can be explicitly converted to any integral
// type large enough to hold it.
if (Context.getTypeSize(SrcType) > Context.getTypeSize(DestType)) {
@@ -227,7 +227,7 @@ Sema::CheckReinterpretCast(Expr *&SrcExpr, QualType DestType,
}
if (SrcType->isIntegralType() || SrcType->isEnumeralType()) {
- assert(destIsPtr);
+ assert(destIsPtr && "One type must be a pointer");
// C++ 5.2.10p5: A value of integral or enumeration type can be explicitly
// converted to a pointer.
return;