brintos

brintos / llvm-project-archived public Read only

0
0
Text · 599 B · 5ffd948 Raw
16 lines · cpp
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-ptr7 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 instead14  // CHECK-FIXES: std::unique_ptr<int> P1 = my::MakeUnique<int>();15}16