[sanitizer] Improve FreeBSD ASLR detection
[llvm-project.git] / clang-tools-extra / test / clang-tidy / infrastructure / duplicate-fixes-of-alias-checkers.cpp
blobf67c20635064adfd9211767ca00029267db87948
1 // RUN: %check_clang_tidy %s cppcoreguidelines-pro-type-member-init,hicpp-member-init,modernize-use-emplace,hicpp-use-emplace %t
3 namespace std {
5 template <typename T>
6 class vector {
7 public:
8 void push_back(const T &) {}
9 void push_back(T &&) {}
11 template <typename... Args>
12 void emplace_back(Args &&... args){};
14 } // namespace std
16 class Foo {
17 public:
18 Foo() : _num1(0)
19 // CHECK-MESSAGES: warning: constructor does not initialize these fields: _num2 [cppcoreguidelines-pro-type-member-init,hicpp-member-init]
21 _num1 = 10;
24 int use_the_members() const {
25 return _num1 + _num2;
28 private:
29 int _num1;
30 int _num2;
31 // CHECK-FIXES: _num2{};
34 int should_use_emplace(std::vector<Foo> &v) {
35 v.push_back(Foo());
36 // CHECK-FIXES: v.emplace_back();
37 // CHECK-MESSAGES: warning: use emplace_back instead of push_back [hicpp-use-emplace,modernize-use-emplace]