]> granicus.if.org Git - clang/commitdiff
silence some warnings in no asserts mode.
authorChris Lattner <sabre@nondot.org>
Fri, 20 Feb 2009 21:37:53 +0000 (21:37 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 20 Feb 2009 21:37:53 +0000 (21:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65169 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaTemplate.cpp

index a47634ba694b5f30aa769605423658824140d3d8..223094b06682f13c62df4007ad9b15a6f1dc8d37 100644 (file)
@@ -1215,11 +1215,11 @@ bool Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param,
     return false;
   }
 
-  if (const PointerType *ParamPtrType = ParamType->getAsPointerType()) {
+  if (ParamType->isPointerType()) {
     //   -- for a non-type template-parameter of type pointer to
     //      object, qualification conversions (4.4) and the
     //      array-to-pointer conversion (4.2) are applied.
-    assert(ParamPtrType->getPointeeType()->isObjectType() &&
+    assert(ParamType->getAsPointerType()->getPointeeType()->isObjectType() &&
            "Only object pointers allowed here");
 
     if (ArgType->isArrayType()) {
@@ -1539,9 +1539,8 @@ Sema::ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec, TagKind TK,
   assert(TemplateParameterLists.size() == 1 && 
          "Clang doesn't handle with ill-formed specializations yet.");
 
-  TemplateParameterList *TemplateParams = 
-    static_cast<TemplateParameterList*>(*TemplateParameterLists.get());
-  assert(TemplateParams->size() == 0 &&
+  assert(static_cast<TemplateParameterList*>(*TemplateParameterLists.get())
+         ->size() == 0 &&
          "Clang doesn't handle class template partial specializations yet");
 
   // Find the class template we're specializing