It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
8 lines
125 B
C++
8 lines
125 B
C++
#include <stdio.h>
|
|
|
|
int main() {
|
|
char tmp;
|
|
[[maybe_unused]] size_t _ = fread(&tmp, sizeof(tmp), 1, stdin);
|
|
return 0;
|
|
}
|