summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/modernize-make-unique-cxx14.cpp
blob: cd35f751bb439dd86af2dc65c7b8874923406809 (plain)
1
2
3
4
5
6
7
8
9
10
11
// RUN: %check_clang_tidy %s modernize-make-unique %t -- -- -std=c++14 \
// RUN:   -I%S/Inputs/modernize-smart-ptr

#include "unique_ptr.h"
// CHECK-FIXES: #include <memory>

void f() {
  auto my_ptr = std::unique_ptr<int>(new int(1));
  // CHECK-MESSAGES: :[[@LINE-1]]:17: warning: use std::make_unique instead
  // CHECK-FIXES: auto my_ptr = std::make_unique<int>(1);
}
OpenPOWER on IntegriCloud