diff options
author | Marc Mutz <marc.mutz@qt.io> | 2023-06-13 10:37:15 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2023-06-20 07:34:09 +0200 |
commit | 603d6351cc32d07a5e4c349d6dc3db0889c3b120 (patch) | |
tree | 9f8c332388d3f3ec0e0cd511435d20e5a0b5b19f /src/corelib/io/qfile.h | |
parent | 21c344a221c1d7712a04d990958b211e2dd8a263 (diff) |
Mark all ctors of [[nodiscard]] classes as Q_NODISCARD_CTOR
This works around around the difference in class-level [[nodiscard]]
behavior between Clang and GCC. While Clang already warns about
QClass(~~~args~~~);
when QClass is marked as [[nodiscard]] at the class level, GCC does
not, and requires the ctor to be marked as [[nodiscard]] instead.
Pick-to: 6.6
Fixes: QTBUG-104164
Change-Id: Ifd7076ee422fb9472ae8bbba43d9bfeee1968a78
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/io/qfile.h')
-rw-r--r-- | src/corelib/io/qfile.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/io/qfile.h b/src/corelib/io/qfile.h index cb06665a9f..1153ba7686 100644 --- a/src/corelib/io/qfile.h +++ b/src/corelib/io/qfile.h @@ -41,6 +41,7 @@ class [[nodiscard]] QNtfsPermissionCheckGuard { Q_DISABLE_COPY_MOVE(QNtfsPermissionCheckGuard) public: + Q_NODISCARD_CTOR QNtfsPermissionCheckGuard() { qEnableNtfsPermissionChecks(); |