Bug 1538030. Disable warning about dereferencing void* in can-run-script test. r=glandium

Some of our builds use --enable-warnings-as-errors and some don't, and I can't
figure out a way to write an expectation comment for that.

Differential Revision: https://phabricator.services.mozilla.com/D24469

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Boris Zbarsky 2019-03-22 03:25:51 +00:00
Родитель c798ef580c
Коммит 7d25b166ca
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -210,10 +210,14 @@ MOZ_CAN_RUN_SCRIPT void test_ref_9() {
test_ref(*(RefCountedBase*)x); // expected-error {{arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument). '*(RefCountedBase*)x' is neither.}}
}
// Ignore warning not related to static analysis here
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wvoid-ptr-dereference"
MOZ_CAN_RUN_SCRIPT void test_ref_10() {
void* x = new RefCountedBase();
test_ref((RefCountedBase&)*x); // expected-error {{arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument). '*x' is neither.}} expected-error {{ISO C++ does not allow indirection on operand of type 'void *'}}
test_ref((RefCountedBase&)*x); // expected-error {{arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument). '*x' is neither.}}
}
#pragma GCC diagnostic pop
MOZ_CAN_RUN_SCRIPT void test_maybe() {
mozilla::Maybe<RefCountedBase*> unsafe;