diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-04-28 22:36:48 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-04-28 22:40:06 +0200 |
commit | cd41fa43089d0977cbf62071c9bfe2322de5d012 (patch) | |
tree | cfa625b06d4794b6744f4e2f1d0f558c107d17c8 /compilerplugins/clang | |
parent | b3acc2944862ff9def6c19c2687a6209a4a191bb (diff) |
Work around FieldDecl::getParent raising assertion
...when inside an ObjCInterfaceDecl, cf. thread starting at
<http://lists.cs.uiuc.edu/pipermail/cfe-dev/2015-April/042629.html>
"FieldDecl::getParent() not working in Objective C code?"
Change-Id: Ifa9b4925979123c6b6fee1b46a1f57803207d3c8
Diffstat (limited to 'compilerplugins/clang')
-rw-r--r-- | compilerplugins/clang/vclwidgets.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compilerplugins/clang/vclwidgets.cxx b/compilerplugins/clang/vclwidgets.cxx index e12e9572b385..f984dcb2ec7b 100644 --- a/compilerplugins/clang/vclwidgets.cxx +++ b/compilerplugins/clang/vclwidgets.cxx @@ -265,7 +265,7 @@ bool VCLWidgets::VisitFieldDecl(const FieldDecl * fieldDecl) { if (fieldDecl->isBitField()) { return true; } - const CXXRecordDecl *pParentRecordDecl = dyn_cast<CXXRecordDecl>(fieldDecl->getParent()); + const CXXRecordDecl *pParentRecordDecl = isa<RecordDecl>(fieldDecl->getDeclContext()) ? dyn_cast<CXXRecordDecl>(fieldDecl->getParent()) : nullptr; if (containsWindowSubclass(fieldDecl->getType())) { // have to ignore this for now, nasty reverse dependency from tools->vcl if (!(pParentRecordDecl != nullptr && pParentRecordDecl->getQualifiedNameAsString() == "ErrorContextImpl")) { |