Skip to content

[clang][ASTMatchers][NFC] fix typos in AST-matchers docs. #141307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 28, 2025

Conversation

vbvictor
Copy link
Contributor

@vbvictor vbvictor commented May 24, 2025

No description provided.

@llvmbot llvmbot added the clang Clang issues not falling into any other category label May 24, 2025
@llvmbot
Copy link
Member

llvmbot commented May 24, 2025

@llvm/pr-subscribers-clang

Author: Baranov Victor (vbvictor)

Changes

Found these typos using CSpell utility.


Full diff: https://github.com/llvm/llvm-project/pull/141307.diff

2 Files Affected:

  • (modified) clang/include/clang/ASTMatchers/ASTMatchers.h (+10-10)
  • (modified) clang/include/clang/ASTMatchers/ASTMatchersInternal.h (+1-1)
diff --git a/clang/include/clang/ASTMatchers/ASTMatchers.h b/clang/include/clang/ASTMatchers/ASTMatchers.h
index e6b684b24b080..e4d605d165324 100644
--- a/clang/include/clang/ASTMatchers/ASTMatchers.h
+++ b/clang/include/clang/ASTMatchers/ASTMatchers.h
@@ -612,7 +612,7 @@ extern const internal::VariadicDynCastAllOfMatcher<Decl,
                                                    TemplateTemplateParmDecl>
     templateTemplateParmDecl;
 
-/// Matches public C++ declarations and C++ base specifers that specify public
+/// Matches public C++ declarations and C++ base specifiers that specify public
 /// inheritance.
 ///
 /// Examples:
@@ -635,7 +635,7 @@ AST_POLYMORPHIC_MATCHER(isPublic,
   return getAccessSpecifier(Node) == AS_public;
 }
 
-/// Matches protected C++ declarations and C++ base specifers that specify
+/// Matches protected C++ declarations and C++ base specifiers that specify
 /// protected inheritance.
 ///
 /// Examples:
@@ -657,8 +657,8 @@ AST_POLYMORPHIC_MATCHER(isProtected,
   return getAccessSpecifier(Node) == AS_protected;
 }
 
-/// Matches private C++ declarations and C++ base specifers that specify private
-/// inheritance.
+/// Matches private C++ declarations and C++ base specifiers that specify
+/// private inheritance.
 ///
 /// Examples:
 /// \code
@@ -1212,7 +1212,7 @@ AST_MATCHER_P(TemplateArgument, refersToIntegralType,
 /// Matches a TemplateArgument of integral type with a given value.
 ///
 /// Note that 'Value' is a string as the template argument's value is
-/// an arbitrary precision integer. 'Value' must be euqal to the canonical
+/// an arbitrary precision integer. 'Value' must be equal to the canonical
 /// representation of that integral value in base 10.
 ///
 /// Given
@@ -5689,7 +5689,7 @@ AST_POLYMORPHIC_MATCHER_P(equalsBoundNode,
   // FIXME: Figure out whether it makes sense to allow this
   // on any other node types.
   // For *Loc it probably does not make sense, as those seem
-  // unique. For NestedNameSepcifier it might make sense, as
+  // unique. For NestedNameSpecifier it might make sense, as
   // those also have pointer identity, but I'm not sure whether
   // they're ever reused.
   internal::NotEqualsBoundNodePredicate Predicate;
@@ -6322,7 +6322,7 @@ AST_MATCHER_P(CXXMethodDecl, forEachOverridden,
   return Matched;
 }
 
-/// Matches declarations of virtual methods and C++ base specifers that specify
+/// Matches declarations of virtual methods and C++ base specifiers that specify
 /// virtual inheritance.
 ///
 /// Example:
@@ -7710,7 +7710,7 @@ extern const AstTypeMatcher<InjectedClassNameType> injectedClassNameType;
 /// \endcode
 extern const AstTypeMatcher<DecayedType> decayedType;
 
-/// Matches the decayed type, whoes decayed type matches \c InnerMatcher
+/// Matches the decayed type, whose decayed type matches \c InnerMatcher
 AST_MATCHER_P(DecayedType, hasDecayedType, internal::Matcher<QualType>,
               InnerType) {
   return InnerType.matches(Node.getDecayedType(), Finder, Builder);
@@ -7750,7 +7750,7 @@ extern const AstTypeMatcher<DependentTemplateSpecializationType>
 ///   }
 /// \endcode
 ///
-/// \c cxxRcordDecl(hasDeclContext(namedDecl(hasName("M")))) matches the
+/// \c cxxRecordDecl(hasDeclContext(namedDecl(hasName("M")))) matches the
 /// declaration of \c class \c D.
 AST_MATCHER_P(Decl, hasDeclContext, internal::Matcher<Decl>, InnerMatcher) {
   const DeclContext *DC = Node.getDeclContext();
@@ -8464,7 +8464,7 @@ AST_MATCHER_P(Stmt, forCallable, internal::Matcher<Decl>, InnerMatcher) {
 /// \endcode
 ///
 /// Example matches f() because it has external formal linkage despite being
-/// unique to the translation unit as though it has internal likage
+/// unique to the translation unit as though it has internal linkage
 /// (matcher = functionDecl(hasExternalFormalLinkage()))
 ///
 /// \code
diff --git a/clang/include/clang/ASTMatchers/ASTMatchersInternal.h b/clang/include/clang/ASTMatchers/ASTMatchersInternal.h
index 4a27a5d099e60..667a044abcef1 100644
--- a/clang/include/clang/ASTMatchers/ASTMatchersInternal.h
+++ b/clang/include/clang/ASTMatchers/ASTMatchersInternal.h
@@ -1034,7 +1034,7 @@ class HasDeclarationMatcher : public MatcherInterface<T> {
     // A SubstTemplateTypeParmType exists solely to mark a type substitution
     // on the instantiated template. As users usually want to match the
     // template parameter on the uninitialized template, we can always desugar
-    // one level without loss of expressivness.
+    // one level without loss of expressiveness.
     // For example, given:
     //   template<typename T> struct X { T t; } class A {}; X<A> a;
     // The following matcher will match, which otherwise would not:

@vbvictor
Copy link
Contributor Author

P.S. Found these typos using CSpell utility.

@vbvictor vbvictor changed the title [ASTMatchers][NFC] fix typos in AST-matchers docs. [clang][ASTMatchers][NFC] fix typos in AST-matchers docs. May 24, 2025
Copy link
Collaborator

@AaronBallman AaronBallman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@vbvictor vbvictor merged commit cfece5a into llvm:main May 28, 2025
11 checks passed
@vbvictor vbvictor deleted the fix-typos-in-AST-matchers branch May 28, 2025 04:29
sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants