aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSergio Martins <smartins@kde.org>2018-02-25 17:10:17 +0000
committerSergio Martins <smartins@kde.org>2018-02-25 17:10:17 +0000
commit8d26cc40fbf69b01dee7fe1f5b9e4c694585b847 (patch)
treecbef3642b2b9be79f3875b390e24d2dfc923b4d3 /src
parentcb66d73cb2664cc5b6b4d19f4b973237907d8c3e (diff)
Fix TypeUtils::derivesFrom()
When comparing pointers of record decls better use the canonical form, so we don't fail for typedefs
Diffstat (limited to 'src')
-rw-r--r--src/TypeUtils.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/TypeUtils.cpp b/src/TypeUtils.cpp
index 0e05f074..9098028b 100644
--- a/src/TypeUtils.cpp
+++ b/src/TypeUtils.cpp
@@ -125,6 +125,7 @@ bool TypeUtils::derivesFrom(const CXXRecordDecl *derived, const CXXRecordDecl *p
const Type *type = base.getType().getTypePtrOrNull();
if (!type) continue;
CXXRecordDecl *baseDecl = type->getAsCXXRecordDecl();
+ baseDecl = baseDecl ? baseDecl->getCanonicalDecl() : nullptr;
if (possibleBase == baseDecl || derivesFrom(baseDecl, possibleBase, baseClasses)) {
if (baseClasses)