]> granicus.if.org Git - clang/commitdiff
silence warning in release-asserts mode about unused variable, also
authorChris Lattner <sabre@nondot.org>
Fri, 12 Dec 2008 07:16:09 +0000 (07:16 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 12 Dec 2008 07:16:09 +0000 (07:16 +0000)
move comment into assert message.

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

include/clang/Analysis/PathSensitive/MemRegion.h

index 90f295d1f972c66796a9352a17ed4fd3c931f480..50d084f22b7e9e03c5dc0bd29fdae8900a11228b 100644 (file)
@@ -420,9 +420,9 @@ class ElementRegion : public TypedRegion {
 
   ElementRegion(SVal Idx, const MemRegion* sReg)
     : TypedRegion(sReg, ElementRegionKind), Index(Idx) {
-    // The index must be signed.
-    if (nonloc::ConcreteInt* CI = dyn_cast<nonloc::ConcreteInt>(&Idx))
-      assert(CI->getValue().isSigned());
+    assert(isa<nonloc::ConcreteInt>(&Idx) &&
+           cast<nonloc::ConcreteInt>(&Idx)->getValue().isSigned() &&
+           "The index must be signed");
   }
 
   static void ProfileRegion(llvm::FoldingSetNodeID& ID, SVal Idx,