path: root/src/printsupport/doc/snippets/code/src_gui_dialogs_qabstractprintdialog.cpp
diff options
authorGiuseppe D'Angelo <>2021-09-18 11:29:23 +0200
committerGiuseppe D'Angelo <>2021-09-19 18:04:06 +0200
commitc578d9943afd4478d9bf813067b002f2679df1d4 (patch)
tree0958fe745c5b1e0c39021f98899630f7306ae674 /src/printsupport/doc/snippets/code/src_gui_dialogs_qabstractprintdialog.cpp
parent7eeda336b4ab45e6869f848d6378043337cd37a1 (diff)
Plaster [[nodiscard]] on some RAII classes
The idea is to prevent silly mistakes such as QMutexLocker(mutex); doSomething(); where the locker is constructed and destroyed immediately. Compilers don't normally warn in these cases (as the constructor/destructor pairs involved do have side effects), but we can mark the type as [[nodiscard]] to encourage warnings. There is another couple of classes for which this would make sense (notably, the R/W lockers), but unfortunately those are exported classes, and GCC has a bug where one can't mix two different attribute syntaxes on the same entity [1], so I'm skipping those. [1] Change-Id: I75a2443dc71e6b80613b8edd52a04d3379355728 Reviewed-by: Qt CI Bot <> Reviewed-by: Volker Hilsheimer <>
Diffstat (limited to 'src/printsupport/doc/snippets/code/src_gui_dialogs_qabstractprintdialog.cpp')
0 files changed, 0 insertions, 0 deletions