diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-08-26 12:35:24 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-08-26 12:35:24 +0200 |
commit | e3e66f7b07a920132c17a57e5434d0a472c6a250 (patch) | |
tree | eee1c5f49a08029a53b85ba177ad7f6cf42e1d79 /compilerplugins | |
parent | aa67fed597bb375d1180d85db7ac90999f86e1a4 (diff) |
Minor improvements of loplugin:staticaccess
Change-Id: I731aab418fb42922208afdaa60d98ccd76377dab
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/clang/staticaccess.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/compilerplugins/clang/staticaccess.cxx b/compilerplugins/clang/staticaccess.cxx index 7b825f39bafa..7fa1d392edb8 100644 --- a/compilerplugins/clang/staticaccess.cxx +++ b/compilerplugins/clang/staticaccess.cxx @@ -18,7 +18,9 @@ bool isStatic(ValueDecl const * decl, bool * memberEnumerator) { // clang::MemberExpr::getMemberDecl is documented to return either a // FieldDecl or a CXXMethodDecl, but can apparently also return a VarDecl // (as C++ static data members are modeled by VarDecl, not FieldDecl) or an - // EnumConstantDecl (struct { enum {E}; } s; s.E;): + // EnumConstantDecl (struct { enum {E}; } s; s.E;), see + // <https://reviews.llvm.org/D23907> "Fix documentation of + // MemberExpr::getMemberDecl": auto fd = dyn_cast<FieldDecl>(decl); if (fd != nullptr) { *memberEnumerator = false; @@ -27,7 +29,8 @@ bool isStatic(ValueDecl const * decl, bool * memberEnumerator) { auto vd = dyn_cast<VarDecl>(decl); if (vd != nullptr) { *memberEnumerator = false; - return vd->isStaticDataMember(); + assert(vd->isStaticDataMember()); + return true; } auto md = dyn_cast<CXXMethodDecl>(decl); if (md != nullptr) { |