[clang] [clang][NFC] Fix example code for memberPointerType() AST matcher (PR #109404)
Carlos Galvez via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 23 02:08:43 PDT 2024
https://github.com/carlosgalvezp updated https://github.com/llvm/llvm-project/pull/109404
>From 96ee182c19926a40331430a661bd959066e56bf9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carlos=20G=C3=A1lvez?= <carlos.galvez at zenseact.com>
Date: Fri, 20 Sep 2024 11:32:07 +0000
Subject: [PATCH] [clang][NFC] Fix example code for memberPointerType() AST
matcher
The example code doesn't compile otherwise.
---
clang/docs/LibASTMatchersReference.html | 8 +++-----
clang/include/clang/ASTMatchers/ASTMatchers.h | 6 +++---
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/clang/docs/LibASTMatchersReference.html b/clang/docs/LibASTMatchersReference.html
index a16b9c44ef0eab..ae25b3797083eb 100644
--- a/clang/docs/LibASTMatchersReference.html
+++ b/clang/docs/LibASTMatchersReference.html
@@ -2675,10 +2675,10 @@ <h2 id="decl-matchers">Node Matchers</h2>
<tr><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('memberPointerType0')"><a name="memberPointerType0Anchor">memberPointerType</a></td><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1MemberPointerType.html">MemberPointerType</a>>...</td></tr>
<tr><td colspan="4" class="doc" id="memberPointerType0"><pre>Matches member pointer types.
Given
- struct A { int i; }
- A::* ptr = A::i;
+ struct A { int i; };
+ int A::* ptr = &A::i;
memberPointerType()
- matches "A::* ptr"
+ matches "int A::* ptr"
</pre></td></tr>
@@ -10659,5 +10659,3 @@ <h2 id="traversal-matchers">AST Traversal Matchers</h2>
</div>
</body>
</html>
-
-
diff --git a/clang/include/clang/ASTMatchers/ASTMatchers.h b/clang/include/clang/ASTMatchers/ASTMatchers.h
index f1c72efc238784..c298ea864177e1 100644
--- a/clang/include/clang/ASTMatchers/ASTMatchers.h
+++ b/clang/include/clang/ASTMatchers/ASTMatchers.h
@@ -7327,11 +7327,11 @@ extern const AstTypeMatcher<BlockPointerType> blockPointerType;
/// Matches member pointer types.
/// Given
/// \code
-/// struct A { int i; }
-/// A::* ptr = A::i;
+/// struct A { int i; };
+/// int A::* ptr = &A::i;
/// \endcode
/// memberPointerType()
-/// matches "A::* ptr"
+/// matches "int A::* ptr"
extern const AstTypeMatcher<MemberPointerType> memberPointerType;
/// Matches pointer types, but does not match Objective-C object pointer
More information about the cfe-commits
mailing list