1// RUN: %check_clang_tidy %s modernize-make-shared %t -- \
2// RUN: -config="{CheckOptions: \
3// RUN: {modernize-make-shared.MakeSmartPtrFunction: 'my::MakeShared', \
4// RUN: modernize-make-shared.MakeSmartPtrFunctionHeader: 'make_shared_util.h' \
5// RUN: }}" \
6// RUN: -- -I %S/Inputs/smart-ptr
7
8#include "shared_ptr.h"
9// CHECK-FIXES: #include "make_shared_util.h"
10
11void f() {
12 std::shared_ptr<int> P1 = std::shared_ptr<int>(new int());
13 // CHECK-MESSAGES: :[[@LINE-1]]:29: warning: use my::MakeShared instead
14 // CHECK-FIXES: std::shared_ptr<int> P1 = my::MakeShared<int>();
15}
16

source code of clang-tools-extra/test/clang-tidy/checkers/modernize/make-shared-header.cpp