[cfe-commits] r58770 - /cfe/trunk/lib/Sema/SemaNamedCast.cpp

Sebastian Redl sebastian.redl at getdesigned.at
Wed Nov 5 14:15:15 PST 2008


Author: cornedbee
Date: Wed Nov  5 16:15:14 2008
New Revision: 58770

URL: http://llvm.org/viewvc/llvm-project?rev=58770&view=rev
Log:
Improve assert messages.

Modified:
    cfe/trunk/lib/Sema/SemaNamedCast.cpp

Modified: cfe/trunk/lib/Sema/SemaNamedCast.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaNamedCast.cpp?rev=58770&r1=58769&r2=58770&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaNamedCast.cpp (original)
+++ cfe/trunk/lib/Sema/SemaNamedCast.cpp Wed Nov  5 16:15:14 2008
@@ -216,7 +216,7 @@
   // 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 @@
   }
 
   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;





More information about the cfe-commits mailing list