]> granicus.if.org Git - clang/commitdiff
With the introduction of nullptr, a template argument that refers to a declaration...
authorDouglas Gregor <dgregor@apple.com>
Sun, 10 May 2009 23:27:08 +0000 (23:27 +0000)
committerDouglas Gregor <dgregor@apple.com>
Sun, 10 May 2009 23:27:08 +0000 (23:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71412 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaTemplate.cpp

index 0c91573180ad355161d8584755723a567258564f..0e1daea23cb64574df3f3e47fdf1528c71d46642 100644 (file)
@@ -1550,7 +1550,7 @@ bool Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param,
         return true;
 
       if (Converted) {
-        Member = cast<NamedDecl>(Context.getCanonicalDecl(Member));
+        Member = cast_or_null<NamedDecl>(Context.getCanonicalDecl(Member));
         Converted->push_back(TemplateArgument(StartLoc, Member));
       }
 
@@ -1562,7 +1562,7 @@ bool Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param,
       return true;
 
     if (Converted) {
-      Entity = cast<NamedDecl>(Context.getCanonicalDecl(Entity));
+      Entity = cast_or_null<NamedDecl>(Context.getCanonicalDecl(Entity));
       Converted->push_back(TemplateArgument(StartLoc, Entity));
     }
     return false;
@@ -1603,7 +1603,7 @@ bool Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param,
       return true;
 
     if (Converted) {
-      Entity = cast<NamedDecl>(Context.getCanonicalDecl(Entity));
+      Entity = cast_or_null<NamedDecl>(Context.getCanonicalDecl(Entity));
       Converted->push_back(TemplateArgument(StartLoc, Entity));
     }
 
@@ -1679,7 +1679,7 @@ bool Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param,
     return true;
   
   if (Converted) {
-    Member = cast<NamedDecl>(Context.getCanonicalDecl(Member));
+    Member = cast_or_null<NamedDecl>(Context.getCanonicalDecl(Member));
     Converted->push_back(TemplateArgument(StartLoc, Member));
   }