aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2013-02-03 16:10:26 +0000
committerDmitri Gribenko <gribozavr@gmail.com>2013-02-03 16:10:26 +0000
commitf8c12146fa2153a6d97b7c92d27d2ece0cd26e79 (patch)
tree5f93fa3dd8557fbdf849f7a15ed5c1705e32a053 /lib/AST/Decl.cpp
parentf06faad8c2983d428859e543ca1581a28b16515b (diff)
Remove unneeded const_casts
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174287 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r--lib/AST/Decl.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index ed2a0c36fd..cdf921de4a 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -587,8 +587,7 @@ void NamedDecl::ClearLinkageCache() {
if (const CXXRecordDecl *record = dyn_cast<CXXRecordDecl>(this))
clearLinkageForClass(record);
- if (ClassTemplateDecl *temp =
- dyn_cast<ClassTemplateDecl>(const_cast<NamedDecl*>(this))) {
+ if (ClassTemplateDecl *temp = dyn_cast<ClassTemplateDecl>(this)) {
// Clear linkage for the template pattern.
CXXRecordDecl *record = temp->getTemplatedDecl();
record->HasCachedLinkage = 0;
@@ -601,8 +600,7 @@ void NamedDecl::ClearLinkageCache() {
}
// Clear cached linkage for function template decls, too.
- if (FunctionTemplateDecl *temp =
- dyn_cast<FunctionTemplateDecl>(const_cast<NamedDecl*>(this))) {
+ if (FunctionTemplateDecl *temp = dyn_cast<FunctionTemplateDecl>(this)) {
temp->getTemplatedDecl()->ClearLinkageCache();
for (FunctionTemplateDecl::spec_iterator
i = temp->spec_begin(), e = temp->spec_end(); i != e; ++i)