Kaydet (Commit) 7892b419 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

loplugin:oncevar: empty strings

...which showed that checking the parent statement (which may be too large to)
in OnceVar::VisitDeclRefExpr is inadequate.

Change-Id: I07fb8ba9e2dfbd0c65a2723737d14abcddcefec4
Reviewed-on: https://gerrit.libreoffice.org/39757Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
Tested-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 9b3e5808
......@@ -14,6 +14,14 @@
namespace loplugin {
TypeCheck TypeCheck::NonConst() const {
return !type_.isNull() && !type_.isConstQualified()
? *this : TypeCheck();
// returning TypeCheck(type_.getUnqualifiedType()) instead of *this
// may look tempting, but could remove sugar we might be interested in
// checking for
}
TypeCheck TypeCheck::NonConstVolatile() const {
return
(!type_.isNull() && !type_.isConstQualified()
......
......@@ -37,6 +37,8 @@ public:
explicit operator bool() const { return !type_.isNull(); }
TypeCheck NonConst() const;
TypeCheck NonConstVolatile() const;
TypeCheck Const() const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment