aboutsummaryrefslogtreecommitdiff
path: root/include/clang/AST/DeclBase.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/AST/DeclBase.h')
-rw-r--r--include/clang/AST/DeclBase.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h
index b0534b8280..ecd7762468 100644
--- a/include/clang/AST/DeclBase.h
+++ b/include/clang/AST/DeclBase.h
@@ -762,12 +762,12 @@ protected:
/// \brief Determine whether two declarations declare the same entity.
inline bool declaresSameEntity(const Decl *D1, const Decl *D2) {
- if (D1 == D2)
- return true;
-
if (!D1 || !D2)
return false;
+ if (D1 == D2)
+ return true;
+
return D1->getCanonicalDecl() == D2->getCanonicalDecl();
}