diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-07-01 13:24:05 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-07-01 13:24:05 +0000 |
| commit | cf1b401909b5e54edfd80656b1a18eaa31f9f6f1 (patch) | |
| tree | edb0ffff2a43d84ba9b4c862b394cfeeebb36ddc /lib/Sema/AnalysisBasedWarnings.cpp | |
| parent | ef915aab0ac566c55bfb0d7a9f6635bb5d94d4af (diff) | |
Notes
Diffstat (limited to 'lib/Sema/AnalysisBasedWarnings.cpp')
| -rw-r--r-- | lib/Sema/AnalysisBasedWarnings.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Sema/AnalysisBasedWarnings.cpp b/lib/Sema/AnalysisBasedWarnings.cpp index 934e13e72d05..fd2d07957c2b 100644 --- a/lib/Sema/AnalysisBasedWarnings.cpp +++ b/lib/Sema/AnalysisBasedWarnings.cpp @@ -305,10 +305,14 @@ static bool isThrowCaught(const CXXThrowExpr *Throw, CaughtType = CaughtType->castAs<ReferenceType>() ->getPointeeType() ->getUnqualifiedDesugaredType(); + if (ThrowType->isPointerType() && CaughtType->isPointerType()) { + ThrowType = ThrowType->getPointeeType()->getUnqualifiedDesugaredType(); + CaughtType = CaughtType->getPointeeType()->getUnqualifiedDesugaredType(); + } if (CaughtType == ThrowType) return true; const CXXRecordDecl *CaughtAsRecordType = - CaughtType->getPointeeCXXRecordDecl(); + CaughtType->getAsCXXRecordDecl(); const CXXRecordDecl *ThrowTypeAsRecordType = ThrowType->getAsCXXRecordDecl(); if (CaughtAsRecordType && ThrowTypeAsRecordType) return ThrowTypeAsRecordType->isDerivedFrom(CaughtAsRecordType); |
