summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2023-06-21 15:12:01 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2023-06-30 12:51:58 +0000
commit68c32ef9724ce81e3df7b519efd95983e4d2ce69 (patch)
treee8c42512c2ed949c07af0d54dc572a3068f93f18
parentca86afb977d665ea80bea94bd1b2fb5629811c00 (diff)
[normative] QUIP-0019: require named ctors to be [[nodiscard]] if ctors should be
There is no reason to distinguish normal from named ctors. Task-number: QTBUG-104164 Change-Id: I8ed01eab0b4343dae0ffaa956f46e2bf88bb26d1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
-rw-r--r--quip-0019-nodiscard-policy.rst5
1 files changed, 5 insertions, 0 deletions
diff --git a/quip-0019-nodiscard-policy.rst b/quip-0019-nodiscard-policy.rst
index 2c4adff..ee09624 100644
--- a/quip-0019-nodiscard-policy.rst
+++ b/quip-0019-nodiscard-policy.rst
@@ -65,6 +65,11 @@ Constructors
2. Qt versions prior to 6.6 lack the macro and therefore can't use
``[[nodiscard]]`` on constructors.
+3. If (1) asks to mark all constructors of a class nodiscard, then
+ _named constructors_ (static functions returning an instance of the
+ class; often prefixed ``from~~~~()`` or ``create~~~()``) SHALL be
+ marked ``[[nodiscard]]``.
+
Other Functions
```````````````