aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Decl.cpp
diff options
context:
space:
mode:
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 2066a98984..33826cbb46 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -702,10 +702,8 @@ llvm::Optional<Visibility> NamedDecl::getExplicitVisibility() const {
// specialization of a class template, check for visibility
// on the pattern.
if (const ClassTemplateSpecializationDecl *spec
- = dyn_cast<ClassTemplateSpecializationDecl>(this)) {
- ClassTemplateDecl *TD = spec->getSpecializedTemplate()->getCanonicalDecl();
- return getVisibilityOf(TD->getTemplatedDecl());
- }
+ = dyn_cast<ClassTemplateSpecializationDecl>(this))
+ return getVisibilityOf(spec->getSpecializedTemplate()->getTemplatedDecl());
// If this is a member class of a specialization of a class template
// and the corresponding decl has explicit visibility, use that.