1 // RUN: %check_clang_tidy %s cppcoreguidelines-pro-type-member-init,hicpp-member-init,modernize-use-emplace,hicpp-use-emplace %t
8 void push_back(const T
&) {}
9 void push_back(T
&&) {}
11 template <typename
... Args
>
12 void emplace_back(Args
&&... args
){};
19 // CHECK-MESSAGES: warning: constructor does not initialize these fields: _num2 [cppcoreguidelines-pro-type-member-init,hicpp-member-init]
24 int use_the_members() const {
31 // CHECK-FIXES: _num2{};
34 int should_use_emplace(std::vector
<Foo
> &v
) {
36 // CHECK-FIXES: v.emplace_back();
37 // CHECK-MESSAGES: warning: use emplace_back instead of push_back [hicpp-use-emplace,modernize-use-emplace]