Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.8.0
-
DaVinci 108
Description
Example: https://doc.qt.io/qt-6/qspan.html#first (in case the link changed in the meantime, this is the template <std::size_t Count> auto QSpan::first() const function).
The auto-generated \note about the conditional noexcept reads:
This function does not throw any exception when "subspan_always_succeeds_v<Count>" is true.
First, the condition should be in fixed-width type, not in ":
This function does not throw any exception when subspan_always_succeeds_v<Count> is true.
The main point, however, is that noexcept doesn't mean "does not throw exception". It means that it's noexcept, meaning if an exception is thrown while executing the function (or any of its callees), the stack is not unwound, but std::terminate() is called immediately.
So the \note is wrong.
Suggested reading:
This function is noexcept when subspan_always_succeeds_v<Count> is true.
If there's a desire to do so, we can then make the "noexcept" in the note be a link to either https://en.cppreference.com/w/cpp/language/noexcept_spec or a page of our own.
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-130888 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
603847,1 | Fix markup of code in noexcept notes | dev | qt/qttools | Status: NEW | 0 | 0 |