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

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