= SpecializedTemplate.dyn_cast<SpecializedPartialSpecialization*>())
return PartialSpec->PartialSpecialization;
- return const_cast<ClassTemplateDecl*>(
- SpecializedTemplate.get<ClassTemplateDecl*>());
+ return SpecializedTemplate.get<ClassTemplateDecl*>();
}
/// \brief Retrieve the class template or class template partial
= SpecializedTemplate.dyn_cast<SpecializedPartialSpecialization*>())
return PartialSpec->PartialSpecialization;
- return const_cast<ClassTemplateDecl*>(
- SpecializedTemplate.get<ClassTemplateDecl*>());
+ return SpecializedTemplate.get<ClassTemplateDecl*>();
}
/// \brief Retrieve the set of template arguments that should be used
/// FIXME: Overload to allow directly matching types?
AST_MATCHER_P(CXXMemberCallExpr, on, internal::Matcher<Expr>,
InnerMatcher) {
- const Expr *ExprNode = const_cast<CXXMemberCallExpr&>(Node)
- .getImplicitObjectArgument()
- ->IgnoreParenImpCasts();
+ const Expr *ExprNode = Node.getImplicitObjectArgument()
+ ->IgnoreParenImpCasts();
return (ExprNode != NULL &&
InnerMatcher.matches(*ExprNode, Finder, Builder));
}
AST_MATCHER_P(CXXMemberCallExpr, onImplicitObjectArgument,
internal::Matcher<Expr>, InnerMatcher) {
- const Expr *ExprNode =
- const_cast<CXXMemberCallExpr&>(Node).getImplicitObjectArgument();
+ const Expr *ExprNode = Node.getImplicitObjectArgument();
return (ExprNode != NULL &&
InnerMatcher.matches(*ExprNode, Finder, Builder));
}
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;
}
// 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)