Use [[noreturn]] on QCommandLineParser::showMessageAndExit()

... instead of Q_NORETURN, as the attribute should be unconditionally
available since C++11.

Amends bad618606d64e943e3fa78e7d1dbc8e1fab55480.

Found in Qt 6.9 API review.

Pick-to: 6.9
Change-Id: Ia008acf0777867f551c7e1cc3423f29f8ed6fbed
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Ivan Solovev 2025-01-13 12:18:47 +01:00
parent 8de8800670
commit 8472004a89
2 changed files with 2 additions and 2 deletions

View File

@ -562,7 +562,7 @@ static inline bool displayMessageBox()
\sa addVersionOption(), showHelp(), showVersion(), QCommandLineParser::MessageType
*/
Q_NORETURN void QCommandLineParser::showMessageAndExit(MessageType type, const QString &message, int exitCode)
[[noreturn]] void QCommandLineParser::showMessageAndExit(MessageType type, const QString &message, int exitCode)
{
#if defined(Q_OS_WIN) && !defined(QT_BOOTSTRAPPED)
if (displayMessageBox()) {

View File

@ -71,7 +71,7 @@ public:
InformationMessage,
ErrorMessage,
};
Q_NORETURN static void showMessageAndExit(MessageType type, const QString &message, int exitCode = 0);
[[noreturn]] static void showMessageAndExit(MessageType type, const QString &message, int exitCode = 0);
private:
Q_DISABLE_COPY(QCommandLineParser)