[clazy] [Bug 367484] reserve-candidate warnings for QVarLengthArray
Mathias Hasselmann via KDE Bugzilla
bugzilla_noreply at kde.org
Fri Aug 19 15:14:09 BST 2016
https://bugs.kde.org/show_bug.cgi?id=367484
--- Comment #2 from Mathias Hasselmann <mathias.hasselmann at kdab.com> ---
(In reply to Sergio Martins from comment #1)
> Wouldn't a reserve make sense in that example ?
Not at all. The purpose of QVarLengthArray is to save the reserve, or rather to
do it right on the stack - therefore the pre-alloc parameter.
> How do you know FooLast - FooFirst isn't bigger than 160 ?
Because this are program specific constants. As they are constexpr clazy can
evaluate them them. I'd expect clang to have API for that evaluations as
compilers have to do those constexpr evaluations all the time.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Unassigned-bugs
mailing list