[clang-tools-extra] r217162 - Plug a unit test memory leak.

Benjamin Kramer benny.kra at googlemail.com
Thu Sep 4 08:15:27 PDT 2014


Author: d0k
Date: Thu Sep  4 10:15:27 2014
New Revision: 217162

URL: http://llvm.org/viewvc/llvm-project?rev=217162&view=rev
Log:
Plug a unit test memory leak.

MatchFinder.addMatcher doesn't take ownership.

Modified:
    clang-tools-extra/trunk/unittests/clang-modernize/TransformTest.cpp

Modified: clang-tools-extra/trunk/unittests/clang-modernize/TransformTest.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clang-modernize/TransformTest.cpp?rev=217162&r1=217161&r2=217162&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clang-modernize/TransformTest.cpp (original)
+++ clang-tools-extra/trunk/unittests/clang-modernize/TransformTest.cpp Thu Sep  4 10:15:27 2014
@@ -271,7 +271,8 @@ TEST(Transform, isFileModifiable) {
 
   DummyTransform T("dummy", Options);
   MatchFinder Finder;
-  Finder.addMatcher(varDecl().bind("decl"), new ModifiableCallback(T));
+  ModifiableCallback Callback(T);
+  Finder.addMatcher(varDecl().bind("decl"), &Callback);
   Tool.run(tooling::newFrontendActionFactory(&Finder).get());
 }
 





More information about the cfe-commits mailing list