Go to file
Marc Mutz 01e1dc273d Remove all class-level [[nodiscard]] from the code-base
A class-level [[nodiscard]] used to be the only way to get a waring
for code such as

   QMutexLocker(&mutex);

with original C++17 means. This was because a few of our compilers
would warn about the presence of [[nodiscard]] on ctors, which is
really the semantics we want: we don't want to prevent users from
passing QMutexLocker out of functions and users of those functions
from ignoring the return value, if they so choose. That should be the
choice of the author of the function returning such types, not ours.

So QUIP-0019 makes class-level [[nodiscard]] conditional on proper
rationale in the user docs (or the commit message in case of private
API). Since none of the existing uses really strikes this author as
particularly convincing, remove them all.

All these classes have gotten Q_NODISCARD_CTOR on all their ctors, so
we continue to provide the same true positive warnings, minus the
false positives when returning from functions, at least on the
majority of compilers (and it's not as if all compilers interpreted a
class-level [[nodiscard]] as a trigger to warn on the initial example
of this commit message).

Task-number: QTBUG-104164
Pick-to: 6.6
Change-Id: I163356486e7c80f9d69bf67023010a88233fe662
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-28 20:48:45 +00:00
.github/workflows Repair github action workflow 2021-11-10 18:57:33 +01:00
bin Add simple project generation based on existing source files 2023-02-08 12:59:19 +01:00
cmake CMake: Require CMake 3.21 when building/using Qt on Apple platforms 2023-06-28 22:09:20 +02:00
coin Use a global value for warning limit when testing documentation in CI 2023-06-27 15:12:31 +00:00
config.tests Remove the mandatory x86-64 features from its feature list 2023-05-31 14:55:37 -07:00
dist Add Qt 6.0.0 changes file 2020-11-16 10:02:08 +02:00
doc Use a global value for warning limit when testing documentation in CI 2023-06-27 15:12:31 +00:00
examples Modernize SimpleTreeModel example 2023-06-28 19:26:45 +00:00
lib Purge all fonts 2015-08-18 19:59:14 +00:00
libexec Pass native path in qt-internal-configure-tests 2023-04-17 23:32:34 +02:00
LICENSES Clarify license of SHA-1 algorithm 2023-04-26 16:36:18 +02:00
mkspecs wasm: update emscripten to 3.1.37 2023-06-26 07:58:11 +02:00
qmake Doc: Document QMAKE_APPLE_DEVICE_ARCHS 2023-06-27 18:36:06 +02:00
src Remove all class-level [[nodiscard]] from the code-base 2023-06-28 20:48:45 +00:00
tests rhi: gl: metal: Enable depth-stencil correctly with multiview 2023-06-28 15:18:28 +02:00
util Make WASM export names different across modules 2023-06-20 09:08:03 +02:00
.cmake.conf CMake: Require CMake 3.21 when building/using Qt on Apple platforms 2023-06-28 22:09:20 +02:00
.gitattributes Give batch files CRLF line endings 2020-11-04 15:02:29 +00:00
.gitignore Add CMakeUserPresets.json to .gitignore 2023-06-23 12:13:08 +02:00
.lgtm.yml Skip LGTM analysis for the bootstrap library and tools 2020-07-16 01:04:34 +02:00
.tag Update the git-archive export options 2012-09-07 15:39:31 +02:00
CMakeLists.txt Introduce QT_ALLOW_SYMLINK_IN_PATHS flag 2023-05-03 19:44:45 +02:00
config_help.txt Introduce -no-vcpkg flag for disabling vcpkg detection/integration 2023-06-27 18:41:00 +02:00
configure Retrieve an old -redo behavior 2023-02-07 18:51:58 +00:00
configure.bat Retrieve an old -redo behavior 2023-02-07 18:51:58 +00:00
configure.cmake Introduce -no-vcpkg flag for disabling vcpkg detection/integration 2023-06-27 18:41:00 +02:00
dependencies.yaml Re-add dependencies.yaml now that qt5.git wip/qt6 builds fine 2019-09-18 13:19:31 +02:00
qt_cmdline.cmake Introduce -no-vcpkg flag for disabling vcpkg detection/integration 2023-06-27 18:41:00 +02:00
sync.profile rhi: Make it a QPA-style private but semi-public API 2023-05-21 15:42:58 +02:00