aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-05-10 23:27:08 +0000
committerDouglas Gregor <dgregor@apple.com>2009-05-10 23:27:08 +0000
commit92d5077d35cb4ac7e3fdb5785fc4e843e9fffdc8 (patch)
treed9d5ae27ba1633ece133ea8e19547d440cf3fe38 /lib/Sema/SemaTemplate.cpp
parentc4ccf01c1223ea13efc5b6dd19ca4916af0daf6a (diff)
With the introduction of nullptr, a template argument that refers to a declaration can now be NULL. Use cast_or_null appropriately
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71412 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r--lib/Sema/SemaTemplate.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index 0c91573180..0e1daea23c 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -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));
}