[clazy] [Bug 365940] New: Warn when using non-owning smart pointers as associative container key
Volker Krause via KDE Bugzilla
bugzilla_noreply at kde.org
Thu Jul 21 11:59:45 BST 2016
https://bugs.kde.org/show_bug.cgi?id=365940
Bug ID: 365940
Summary: Warn when using non-owning smart pointers as
associative container key
Product: clazy
Version: unspecified
Platform: Other
OS: Linux
Status: UNCONFIRMED
Severity: wishlist
Priority: NOR
Component: general
Assignee: unassigned-bugs at kde.org
Reporter: vkrause at kde.org
CC: smartins at kde.org
Quoting -Wmarc: "The values of keys in an associated container are not supposed
to change over time, thus they are marked as const in the std containers. But
some types can change their values under the hood while being stored as const.
Examples of such types as QPointer, weak_ptr, QWeakPointer, but also
QPersistentModelIndex. As they change, the container's class invariants are
broken (order in sorted and hash value unordered associative containers), and
accessing such a container results in undefined behaviour."
Reproducible: Always
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Unassigned-bugs
mailing list