[clazy] [Bug 407321] New: clazy-qvariant-template-instantiation: don't warn about type aliases
Milian Wolff
bugzilla_noreply at kde.org
Wed May 8 08:27:25 BST 2019
https://bugs.kde.org/show_bug.cgi?id=407321
Bug ID: 407321
Summary: clazy-qvariant-template-instantiation: don't warn
about type aliases
Product: clazy
Version: unspecified
Platform: Other
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: general
Assignee: unassigned-bugs at kde.org
Reporter: mail at milianw.de
CC: smartins at kde.org
Target Milestone: ---
SUMMARY
I want to suggest that QVariant::value shouldn't warn when we pass a type
alias. The type alias may be platform dependent, and thus it's not always clear
that e.g. QVariant::value<quintptr> should be replaced by toUnsigned long long.
Also, it makes the code harder to understand I believe.
Unrelated: couldn't we fix this whole issue upstream by explicitly specializing
value<> for the builtin types and forwarding those to the toX functions?
STEPS TO REPRODUCE
line 250: settings.conversion.color = value.value<QRgb>();
=> Use QVariant::toUnsigned int() instead of QVariant::value<unsigned int>()
line 176: return reinterpret_cast<QDockWidget
*>(tabBar->tabData(tabIndex).value<quintptr>());
=> Use QVariant::toUnsigned long long() instead of QVariant::value<unsigned
long long>()
OBSERVED RESULT
warnings for typealiases
EXPECTED RESULT
no warnings
SOFTWARE/OS VERSIONS
Windows:
macOS:
Linux/KDE Plasma:
(available in About System)
KDE Plasma Version:
KDE Frameworks Version:
Qt Version:
ADDITIONAL INFORMATION
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Unassigned-bugs
mailing list