Avoid using memset on a not-trivial type like nsTabSizes

nsTabSizes is non-trivial only because of the user-defined constructor.  The idea desired here is certainly to zero all the members without listing them -- but the very act of doing so with a user-defined constructor, makes the idea impossible.

Arguably this is something that is permissible in the language, and that the warning should be tailored to permit.  I don't think this falls afoul of any of the issues flagged in https://gcc.gnu.org/ml/gcc-patches/2017-06/msg01527.html for example.  In the meantime, just explicitly zeroing the three member fields is easy and fixes the warnings.
This commit is contained in:
trav90 2018-08-18 15:10:01 -05:00 committed by Roy Tam
commit eb09900afe

View file

@ -18,7 +18,12 @@ public:
Other // Everything else.
};
nsTabSizes() { mozilla::PodZero(this); }
nsTabSizes()
: mDom(0)
, mStyle(0)
, mOther(0)
{
}
void add(Kind kind, size_t n)
{