summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Decl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r--clang/lib/AST/Decl.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index 79c51aca315..9bf35ee83d6 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -205,6 +205,15 @@ bool NamedDecl::declarationReplaces(NamedDecl *OldD) const {
return this->getKind() == OldD->getKind();
}
+bool NamedDecl::hasLinkage() const {
+ if (const VarDecl *VD = dyn_cast<VarDecl>(this))
+ return VD->hasExternalStorage() || VD->isFileVarDecl();
+
+ if (isa<FunctionDecl>(this) && !isa<CXXMethodDecl>(this))
+ return true;
+
+ return false;
+}
//===----------------------------------------------------------------------===//
// VarDecl Implementation
OpenPOWER on IntegriCloud