On 08/24/2017 06:04 AM, jyaven...@mozilla.com wrote:
On Thursday, August 24, 2017 at 11:56:53 AM UTC+2, James Cheng wrote:
How could I make it compile error?
I did write
RefPtr<Foo> xxx = yyy;
xxx.forget();
You need to run the static analyser.
The documentation about MOZ_MUST_USE_TYPE is explained there
http://searchfox.org/mozilla-central/source/mfbt/Attributes.h#519-521.
This is why you should always do a try run, because the static analyser *will*
choke on this code.
You can also run the static analyzer locally by using a clang binary
downloaded from llvm.org, and adding the following line to your
mozconfig file:
ac_add_options --enable-clang-plugin
We will (hopefully sometime soon) make this extremely easy to do on all
platforms without needing to download a custom clang or change anything
in your mozconfig through a new mach command when
https://bugzilla.mozilla.org/show_bug.cgi?id=1328454 is finally fixed.
Cheers,
Ehsan
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform