diff options
author | George Burgess IV <george.burgess.iv@gmail.com> | 2018-03-01 05:43:23 +0000 |
---|---|---|
committer | George Burgess IV <george.burgess.iv@gmail.com> | 2018-03-01 05:43:23 +0000 |
commit | f6b7996bf623151fc1a9dfbcf659a609b178692f (patch) | |
tree | 3ed944a154c12478b2d7c6ffd929afff1ba56534 /lib/Sema/SemaTemplateInstantiate.cpp | |
parent | b7f026ae77d2cb0cd10834b61aac0037cfcff2bd (diff) |
Remove redundant casts. NFC
So I wrote a clang-tidy check to lint out redundant `isa`, `cast`, and
`dyn_cast`s for fun. This is a portion of what it found for clang; I
plan to do similar cleanups in LLVM and other subprojects when I find
time.
Because of the volume of changes, I explicitly avoided making any change
that wasn't highly local and obviously correct to me (e.g. we still have
a number of foo(cast<Bar>(baz)) that I didn't touch, since overloading
is a thing and the cast<Bar> did actually change the type -- just up the
class hierarchy).
I also tried to leave the types we were cast<>ing to somewhere nearby,
in cases where it wasn't locally obvious what we were dealing with
before.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326416 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiate.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index 2c4f649078..bcc1e66fb0 100644 --- a/lib/Sema/SemaTemplateInstantiate.cpp +++ b/lib/Sema/SemaTemplateInstantiate.cpp @@ -1261,7 +1261,7 @@ ExprResult TemplateInstantiator::transformNonTypeTemplateParmRef( arg.getKind() == TemplateArgument::NullPtr) { ValueDecl *VD; if (arg.getKind() == TemplateArgument::Declaration) { - VD = cast<ValueDecl>(arg.getAsDecl()); + VD = arg.getAsDecl(); // Find the instantiation of the template argument. This is // required for nested templates. |