summaryrefslogtreecommitdiffstats
path: root/compilerplugins
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-09-05 09:38:30 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-09-05 09:38:58 +0200
commit4f2bc21685b1eb30d3a7808ab021fd178652e411 (patch)
tree4a882a90944ef9e906ceae214ef63121dfb1e2dd /compilerplugins
parentcui: fix loplugin:unnecessaryparen warnings (diff)
downloadcore-4f2bc21685b1eb30d3a7808ab021fd178652e411.tar.gz
core-4f2bc21685b1eb30d3a7808ab021fd178652e411.zip
When traversing a TemplateDecl, ts can be a dependent type
Change-Id: I05b02ef807a12a802720f58cd5a2d6d370b42418
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/dyncastvisibility.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/compilerplugins/clang/dyncastvisibility.cxx b/compilerplugins/clang/dyncastvisibility.cxx
index e212d7f2254d..31d20fba80d7 100644
--- a/compilerplugins/clang/dyncastvisibility.cxx
+++ b/compilerplugins/clang/dyncastvisibility.cxx
@@ -108,7 +108,9 @@ public:
ts = t->getPointeeType();
}
auto const rts = ts->getAs<RecordType>();
- assert(rts != nullptr);
+ if (rts == nullptr) { // in case it's a dependent type
+ return true;
+ }
auto const rds = cast<CXXRecordDecl>(rts->getDecl())->getDefinition();
assert(rds != nullptr);
Bases bs;