[PATCH] D43766: [clang-tidy][modernize-make-unique] Checks c++14 flag before using std::make_unique

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 28 04:04:56 PST 2018


alexfh added inline comments.


================
Comment at: test/clang-tidy/modernize-make-unique-cxx11.cpp:5
+#include "unique_ptr.h"
+// CHECK-FIXES-NOT: #include <memory>
+
----------------
I'd better use positive assertions with the original text. Otherwise the test can pass if the check does any replacements except for the ones you list in CHECK-FIXES-NOT.


================
Comment at: test/clang-tidy/modernize-make-unique-header.cpp:8
 // RUN:     ]}" \
-// RUN:   -- -std=c++11 -I%S/Inputs/modernize-smart-ptr
+// RUN:   -- -std=c++14 -I%S/Inputs/modernize-smart-ptr
 
----------------
As Haojian mentioned, this test still has to work in c++11.


https://reviews.llvm.org/D43766





More information about the cfe-commits mailing list