https://github.com/thevar1able created 
https://github.com/llvm/llvm-project/pull/112283

None

>From 31e4d362b6466b101cdf896003c6c264786b3f2a Mon Sep 17 00:00:00 2001
From: Konstantin Bogdanov <var1able@var1able.network>
Date: Tue, 15 Oct 2024 01:21:21 +0200
Subject: [PATCH] Fix a typo

---
 .../CrtpConstructorAccessibilityCheck.cpp        |  2 +-
 .../bugprone/crtp-constructor-accessibility.cpp  | 16 ++++++++--------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git 
a/clang-tools-extra/clang-tidy/bugprone/CrtpConstructorAccessibilityCheck.cpp 
b/clang-tools-extra/clang-tidy/bugprone/CrtpConstructorAccessibilityCheck.cpp
index 6175fcdfd229c3..8eaf54fe0088a4 100644
--- 
a/clang-tools-extra/clang-tidy/bugprone/CrtpConstructorAccessibilityCheck.cpp
+++ 
b/clang-tools-extra/clang-tidy/bugprone/CrtpConstructorAccessibilityCheck.cpp
@@ -165,7 +165,7 @@ void CrtpConstructorAccessibilityCheck::check(
 
     WithFriendHintIfNeeded(
         diag(Ctor->getLocation(),
-             "%0 contructor allows the CRTP to be %select{inherited "
+             "%0 constructor allows the CRTP to be %select{inherited "
              "from|constructed}1 as a regular template class; consider making "
              "it private%select{| and declaring the derived class as friend}2")
             << Access << IsPublic << NeedsFriend
diff --git 
a/clang-tools-extra/test/clang-tidy/checkers/bugprone/crtp-constructor-accessibility.cpp
 
b/clang-tools-extra/test/clang-tidy/checkers/bugprone/crtp-constructor-accessibility.cpp
index cb41923df157cf..f33b8457cc8af5 100644
--- 
a/clang-tools-extra/test/clang-tidy/checkers/bugprone/crtp-constructor-accessibility.cpp
+++ 
b/clang-tools-extra/test/clang-tidy/checkers/bugprone/crtp-constructor-accessibility.cpp
@@ -26,7 +26,7 @@ template <typename T>
 class CRTP {
 public:
     CRTP() = default;
-    // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public contructor allows the 
CRTP to be constructed as a regular template class; consider making it private 
and declaring the derived class as friend 
[bugprone-crtp-constructor-accessibility]
+    // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public constructor allows the 
CRTP to be constructed as a regular template class; consider making it private 
and declaring the derived class as friend 
[bugprone-crtp-constructor-accessibility]
     // CHECK-FIXES: private:{{[[:space:]]*}}CRTP() = 
default;{{[[:space:]]*}}public:
     // CHECK-FIXES: friend T;
 };
@@ -39,7 +39,7 @@ template <typename T>
 class CRTP {
 public:
     CRTP(int) {}
-    // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public contructor allows the 
CRTP to be constructed as a regular template class; consider making it private 
and declaring the derived class as friend 
[bugprone-crtp-constructor-accessibility]
+    // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public constructor allows the 
CRTP to be constructed as a regular template class; consider making it private 
and declaring the derived class as friend 
[bugprone-crtp-constructor-accessibility]
     // CHECK-FIXES: private:{{[[:space:]]*}}CRTP(int) {}{{[[:space:]]*}}public:
     // CHECK-FIXES: friend T;
 };
@@ -52,10 +52,10 @@ template <typename T>
 class CRTP {
 public:
     CRTP(int) {}
-    // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public contructor allows the 
CRTP to be constructed as a regular template class; consider making it private 
and declaring the derived class as friend 
[bugprone-crtp-constructor-accessibility]
+    // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public constructor allows the 
CRTP to be constructed as a regular template class; consider making it private 
and declaring the derived class as friend 
[bugprone-crtp-constructor-accessibility]
     // CHECK-FIXES: private:{{[[:space:]]*}}CRTP(int) {}{{[[:space:]]*}}public:
     CRTP(float) {}
-    // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public contructor allows the 
CRTP to be constructed as a regular template class; consider making it private 
and declaring the derived class as friend 
[bugprone-crtp-constructor-accessibility]
+    // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public constructor allows the 
CRTP to be constructed as a regular template class; consider making it private 
and declaring the derived class as friend 
[bugprone-crtp-constructor-accessibility]
     // CHECK-FIXES: private:{{[[:space:]]*}}CRTP(float) 
{}{{[[:space:]]*}}public:
     
     // CHECK-FIXES: friend T;
@@ -70,13 +70,13 @@ template <typename T>
 class CRTP {
 protected:
     CRTP(int) {}
-    // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: protected contructor allows 
the CRTP to be inherited from as a regular template class; consider making it 
private and declaring the derived class as friend 
[bugprone-crtp-constructor-accessibility]
+    // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: protected constructor allows 
the CRTP to be inherited from as a regular template class; consider making it 
private and declaring the derived class as friend 
[bugprone-crtp-constructor-accessibility]
     // CHECK-FIXES: private:{{[[:space:]]*}}CRTP(int) 
{}{{[[:space:]]*}}protected:
     CRTP() = default;
-    // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: protected contructor allows 
the CRTP to be inherited from as a regular template class; consider making it 
private and declaring the derived class as friend 
[bugprone-crtp-constructor-accessibility]
+    // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: protected constructor allows 
the CRTP to be inherited from as a regular template class; consider making it 
private and declaring the derived class as friend 
[bugprone-crtp-constructor-accessibility]
     // CHECK-FIXES: private:{{[[:space:]]*}}CRTP() = 
default;{{[[:space:]]*}}protected:
     CRTP(float) {}
-    // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: protected contructor allows 
the CRTP to be inherited from as a regular template class; consider making it 
private and declaring the derived class as friend 
[bugprone-crtp-constructor-accessibility]
+    // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: protected constructor allows 
the CRTP to be inherited from as a regular template class; consider making it 
private and declaring the derived class as friend 
[bugprone-crtp-constructor-accessibility]
     // CHECK-FIXES: private:{{[[:space:]]*}}CRTP(float) 
{}{{[[:space:]]*}}protected:
     
     // CHECK-FIXES: friend T;
@@ -101,7 +101,7 @@ namespace struct_default_ctor {
 template <typename T>
 struct CRTP {
     CRTP() = default;
-    // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public contructor allows the 
CRTP to be constructed as a regular template class; consider making it private 
and declaring the derived class as friend 
[bugprone-crtp-constructor-accessibility]
+    // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public constructor allows the 
CRTP to be constructed as a regular template class; consider making it private 
and declaring the derived class as friend 
[bugprone-crtp-constructor-accessibility]
     // CHECK-FIXES: private:{{[[:space:]]*}}CRTP() = 
default;{{[[:space:]]*}}public:
     // CHECK-FIXES: friend T;
 };

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to