[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
Fri Dec 9 00:57:59 PST 2022


hokein created this revision.
hokein added a reviewer: VitaNuo.
Herald added a subscriber: kadircet.
Herald added a project: All.
hokein requested review of this revision.
Herald added a project: clang-tools-extra.

This is a test I missed to mention in https://reviews.llvm.org/D139087.


Repository:
  rG LLVM Github Monorepo

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,18 @@
            "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.481546.patch
Type: text/x-patch
Size: 929 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221209/cab2e193/attachment.bin>


More information about the cfe-commits mailing list