QMetaTypeModuleHelper: mark instances constexpr
Static and thread-local objects should be constexpr or constinit if possible. Task-number: QTBUG-100485 Pick-to: 6.6 6.5 Change-Id: I29088798a50d6278252c9088e7c191c4214b2e5b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 88c3cd6e08c86bfb5bb676ceed4c92344f8ed91c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
ede7d80b39
commit
7b5df411db
@ -955,7 +955,7 @@ static const struct { const char * typeName; int typeNameLength; int type; } typ
|
|||||||
};
|
};
|
||||||
|
|
||||||
// NOLINTNEXTLINE(cppcoreguidelines-virtual-class-destructor): this is not a base class
|
// NOLINTNEXTLINE(cppcoreguidelines-virtual-class-destructor): this is not a base class
|
||||||
static const struct : QMetaTypeModuleHelper
|
static constexpr struct : QMetaTypeModuleHelper
|
||||||
{
|
{
|
||||||
template<typename T, typename LiteralWrapper =
|
template<typename T, typename LiteralWrapper =
|
||||||
std::conditional_t<std::is_same_v<T, QString>, QLatin1StringView, const char *>>
|
std::conditional_t<std::is_same_v<T, QString>, QLatin1StringView, const char *>>
|
||||||
|
@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
// NOLINTNEXTLINE(cppcoreguidelines-virtual-class-destructor): this is not a base class
|
// NOLINTNEXTLINE(cppcoreguidelines-virtual-class-destructor): this is not a base class
|
||||||
static const struct : QMetaTypeModuleHelper
|
static constexpr struct : QMetaTypeModuleHelper
|
||||||
{
|
{
|
||||||
#define QT_IMPL_METATYPEINTERFACE_GUI_TYPES(MetaTypeName, MetaTypeId, RealName) \
|
#define QT_IMPL_METATYPEINTERFACE_GUI_TYPES(MetaTypeName, MetaTypeId, RealName) \
|
||||||
QT_METATYPE_INTERFACE_INIT(RealName),
|
QT_METATYPE_INTERFACE_INIT(RealName),
|
||||||
|
@ -13,7 +13,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
// NOLINTNEXTLINE(cppcoreguidelines-virtual-class-destructor): this is not a base class
|
// NOLINTNEXTLINE(cppcoreguidelines-virtual-class-destructor): this is not a base class
|
||||||
static const struct : QMetaTypeModuleHelper
|
static constexpr struct : QMetaTypeModuleHelper
|
||||||
{
|
{
|
||||||
const QtPrivate::QMetaTypeInterface *interfaceForType(int type) const override {
|
const QtPrivate::QMetaTypeInterface *interfaceForType(int type) const override {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user