Closed Bug 1473217 (clang-tidy-unused-raii) Opened 7 years ago Closed 6 years ago

Fix and enable clang-tidy's misc-unused-raii warnings

Categories

(Core :: DOM: Core & HTML, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla64
Tracking Status
firefox-esr52 --- wontfix
firefox-esr60 --- wontfix
firefox61 --- wontfix
firefox62 --- wontfix
firefox63 --- fixed
firefox64 --- fixed

People

(Reporter: cpeterson, Assigned: cpeterson)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

clang-tidy's misc-unused-raii check finds temporary objects that look like RAII objects: https://clang.llvm.org/extra/clang-tidy/checks/bugprone-unused-raii.html The canonical example for this is a scoped lock object missing a name: { scoped_lock(&global_mutex); critical_section(); } The destructor of the scoped_lock is called before the critical_section is entered, leaving it unprotected.
Comment on attachment 8989833 [details] Bug 1473217 - Part 3: Enable clang-tidy's misc-unused-raii warnings. https://reviewboard.mozilla.org/r/254794/#review261758
Attachment #8989833 - Flags: review?(bpostelnicu) → review+
Comment on attachment 8989832 [details] Bug 1473217 - Part 2: dom: Fix clang-tidy's misc-unused-raii warnings. https://reviewboard.mozilla.org/r/254792/#review262776
Attachment #8989832 - Flags: review?(amarchesini) → review+
I will land patches 2 and 3 while waiting for patch 1 review.
Pushed by cpeterson@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/bfb8b44ccc42 Part 2: dom: Fix misc-unused-raii warnings. r=baku https://hg.mozilla.org/integration/mozilla-inbound/rev/cb66954c173f Part 3: clang-tidy: Enable misc-unused-raii check. r=andi
Comment on attachment 8989831 [details] Bug 1473217 - Part 1: webspeech: Fix clang-tidy's misc-unused-raii warning. Sorry, missed that. Obvious fix
Attachment #8989831 - Flags: review?(rjesup) → review+
Pushed by cpeterson@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/67f6872c7302 webspeech: Fix clang-tidy's misc-unused-raii warning. r=jesup
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: