From 84ff636ecf90342ccb81a67d526f42731cd07793 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 1 Nov 2018 09:47:14 +0100 Subject: [PATCH] Logging: Explicitly cast Q_FUNC_INFO and __FILE__ to const char * Otherwise they might end up as const char[], which clang-tidy complains about because it implicitly decays into a pointer when passed to the QMessageLogger ctor. Change-Id: I0d223f0c94cb63be6fc2a165348f143fadaf11ea Reviewed-by: Thiago Macieira --- src/corelib/global/qlogging.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/global/qlogging.h b/src/corelib/global/qlogging.h index 16e01183bd..dded09999b 100644 --- a/src/corelib/global/qlogging.h +++ b/src/corelib/global/qlogging.h @@ -153,9 +153,9 @@ private: #endif #ifdef QT_MESSAGELOGCONTEXT - #define QT_MESSAGELOG_FILE __FILE__ + #define QT_MESSAGELOG_FILE static_cast(__FILE__) #define QT_MESSAGELOG_LINE __LINE__ - #define QT_MESSAGELOG_FUNC Q_FUNC_INFO + #define QT_MESSAGELOG_FUNC static_cast(Q_FUNC_INFO) #else #define QT_MESSAGELOG_FILE nullptr #define QT_MESSAGELOG_LINE 0