From b002c48cc799ebe613ed5fadebd0f5956e214388 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 15 Oct 2020 08:38:48 +0200 Subject: [PATCH] Disallow promotion of bool and char in qMin and friends MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Feedback on the API review. Make sure, qMin and similar constructs don't compile. Change-Id: I59a66348a4168fe306159ddaf2595838d4ed66d1 Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Thiago Macieira --- src/corelib/global/qglobal.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 6999538ee8..d9ba41e70a 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -642,7 +642,9 @@ namespace detail { template && std::is_arithmetic_v && std::is_floating_point_v == std::is_floating_point_v && - std::is_signed_v == std::is_signed_v> > + std::is_signed_v == std::is_signed_v && + !std::is_same_v && !std::is_same_v && + !std::is_same_v && !std::is_same_v>> struct Promoted { using type = decltype(T() + U());