Open d97321dc-6cbe-4326-88f1-0c062d53aa69 opened 4 years ago
Initialising a vector like that is redundant in all contexts, not just member initialisation.
Clang-tidy has a readability-redundant-string-init for string initialisation, maybe a similar check could be added for initialising containers.
Actually this is a bug, simply because it will lead to memory allocation of 0 bytes. And this is not in scope of this check. New check should be created.
Extended Description
It would be great if clang-tidy "modernize-use-default-member-init" was flagging redundant initializers of std::vector with 0.
include
class TXX { public: explicit TXX() : m_1(0) {} private: std::vector m_1;
};