-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[Clang] fix diagnostic to correctly handle singular and plural cases for redundant qualifiers on base class type #125943
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
Conversation
@llvm/pr-subscribers-clang Author: Oleksandr T. (a-tarasyuk) ChangesFixes #125942 Full diff: https://github.com/llvm/llvm-project/pull/125943.diff 2 Files Affected:
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 7b3b932c482baa..bcae9e9f300938 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -490,7 +490,7 @@ def warn_qual_return_type : Warning<
"'%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect">,
InGroup<IgnoredQualifiers>, DefaultIgnore;
def warn_qual_base_type : Warning<
- "'%0' qualifier%s1 on base class type %2 have no effect">,
+ "'%0' qualifier%s1 on base class type %2 %plural{1:has|:have}1 no effect">,
InGroup<IgnoredQualifiers>, DefaultIgnore;
def warn_deprecated_redundant_constexpr_static_def : Warning<
diff --git a/clang/test/SemaCXX/warn-base-type-qualifiers.cpp b/clang/test/SemaCXX/warn-base-type-qualifiers.cpp
index b9fd577c574b99..7c775a552dd886 100644
--- a/clang/test/SemaCXX/warn-base-type-qualifiers.cpp
+++ b/clang/test/SemaCXX/warn-base-type-qualifiers.cpp
@@ -8,7 +8,7 @@ template <typename T> using add_const_t = typename add_const<T>::type;
class A { };
typedef const A A_Const;
-class B : public A_Const { }; // expected-warning {{'const' qualifier on base class type 'A_Const' (aka 'const A') have no effect}} \
+class B : public A_Const { }; // expected-warning {{'const' qualifier on base class type 'A_Const' (aka 'const A') has no effect}} \
// expected-note {{base class 'A_Const' (aka 'const A') specified here}}
typedef const volatile A A_Const_Volatile;
@@ -19,7 +19,7 @@ struct D {
D(int);
};
-template <typename T> struct E : T { // expected-warning {{'const' qualifier on base class type 'const D' have no effect}} \
+template <typename T> struct E : T { // expected-warning {{'const' qualifier on base class type 'const D' has no effect}} \
// expected-note {{base class 'const D' specified here}}
using T::T;
E(int &) : E(0) {}
@@ -27,7 +27,7 @@ template <typename T> struct E : T { // expected-warning {{'const' qualifier on
E<const D> e(1); // expected-note {{in instantiation of template class 'E<const D>' requested here}}
template <typename T>
-struct G : add_const<T>::type { // expected-warning {{'const' qualifier on base class type 'add_const<D>::type' (aka 'const D') have no effect}} \
+struct G : add_const<T>::type { // expected-warning {{'const' qualifier on base class type 'add_const<D>::type' (aka 'const D') has no effect}} \
// expected-note {{base class 'add_const<D>::type' (aka 'const D') specified here}}
using T::T;
G(int &) : G(0) {}
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please improve the commit message to better explain what is going on, else LGTM.
…for redundant qualifiers on base class type
b2f1298
to
55c179b
Compare
@erichkeane thanks. I've changed the title/commit message. |
You did not unfortunately, so the commit has just:
PLEASE next time make sure the description of the PR (and thus the final commit message) describes the problem, and what you're doing to solve it. |
…for redundant qualifiers on base class type (llvm#125943) Fixes llvm#125942
Fixes #125942