QLatin1/String/View: don't decay the arg() arguments
This turns const char[] arrays into const char* pointers and therefore prevents the implicit conversion of string literals to QString in QT_RESTRICTED_CAST_FROM_ASCII. Fix by avoiding the decay. Also simplify the template magic. Pick-to: 6.5 6.4 6.2 5.15 Change-Id: I88164a1866ac71b41d9cd1564f3a5e83d2d42aaa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
67d7d8746c
commit
ba52b29d33
|
|
@ -538,14 +538,11 @@ public:
|
|||
QChar fillChar = u' ') const;
|
||||
private:
|
||||
template <typename T>
|
||||
struct is_convertible_to_view_or_qstring_helper
|
||||
: std::integral_constant<bool,
|
||||
std::is_convertible<T, QString>::value ||
|
||||
std::is_convertible<T, QStringView>::value ||
|
||||
std::is_convertible<T, QLatin1StringView>::value> {};
|
||||
template <typename T>
|
||||
struct is_convertible_to_view_or_qstring
|
||||
: is_convertible_to_view_or_qstring_helper<typename std::decay<T>::type> {};
|
||||
using is_convertible_to_view_or_qstring = std::disjunction<
|
||||
std::is_convertible<T, QString>,
|
||||
std::is_convertible<T, QStringView>,
|
||||
std::is_convertible<T, QLatin1StringView>
|
||||
>;
|
||||
public:
|
||||
template <typename...Args>
|
||||
[[nodiscard]]
|
||||
|
|
|
|||
Loading…
Reference in New Issue