[PATCH] D139696: [include-cleaner] Add a unique_ptr-style member expr test in WalkASTTest.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 12 00:59:10 PST 2022


This revision was automatically updated to reflect the committed changes.
hokein marked an inline comment as done.
Closed by commit rG4ce6dfbcd6f0: [include-cleaner] Add a unique_ptr-style member expr test in WalkASTTest. (authored by hokein).

Changed prior to commit:
  https://reviews.llvm.org/D139696?vs=481546&id=482019#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139696/new/

https://reviews.llvm.org/D139696

Files:
  clang-tools-extra/include-cleaner/unittests/WalkASTTest.cpp


Index: clang-tools-extra/include-cleaner/unittests/WalkASTTest.cpp
===================================================================
--- clang-tools-extra/include-cleaner/unittests/WalkASTTest.cpp
+++ clang-tools-extra/include-cleaner/unittests/WalkASTTest.cpp
@@ -196,6 +196,20 @@
            "Derived foo(); void fun() { foo().^a; }");
   testWalk("struct Base { int a; }; struct $explicit^Derived : public Base {};",
            "Derived& foo(); void fun() { foo().^a; }");
+  testWalk(R"cpp(
+      template <typename T>
+      struct unique_ptr {
+        T *operator->();
+      };
+      struct $explicit^Foo { int a; };)cpp",
+           "void test(unique_ptr<Foo> &V) { V->^a; }");
+  testWalk(R"cpp(
+      template <typename T>
+      struct $explicit^unique_ptr {
+        void release();
+      };
+      struct Foo {};)cpp",
+           "void test(unique_ptr<Foo> &V) { V.^release(); }");
 }
 
 TEST(WalkAST, ConstructExprs) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139696.482019.patch
Type: text/x-patch
Size: 943 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221212/f3427468/attachment.bin>


More information about the cfe-commits mailing list