diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-09-03 14:51:10 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-09-03 16:57:06 +0200 |
commit | ea061cbe1bfb912c692473bb5e2755b3e15ac375 (patch) | |
tree | f4329ee327a9ca711fbefc978a042291f30e84da /compilerplugins | |
parent | bf72417c53cbb564d7f28718b244ce94541f740c (diff) |
Fix check for member Decl's name
...as some members like
OUString::operator std::u16string_view()
don't have a name
Change-Id: I3ac9bbc43cdf899d4ab0483a95f00097f4b6f20a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102001
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/clang/stringstatic.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compilerplugins/clang/stringstatic.cxx b/compilerplugins/clang/stringstatic.cxx index c5753445fc34..fcc984b0515b 100644 --- a/compilerplugins/clang/stringstatic.cxx +++ b/compilerplugins/clang/stringstatic.cxx @@ -187,7 +187,8 @@ bool StringStatic::VisitMemberExpr(MemberExpr const * expr) return true; if (potentialVars.count(varDecl) == 0) return true; - if (expr->getMemberDecl()->getName() != "pData") { + auto const id = expr->getMemberDecl()->getIdentifier(); + if (id == nullptr || id->getName() != "pData") { return true; } excludeVars.insert(varDecl); |