Issue |
125942
|
Summary |
Ungrammatical warning message "const qualifier have no effect"
|
Labels |
clang:diagnostics
|
Assignees |
a-tarasyuk
|
Reporter |
a-tarasyuk
|
https://godbolt.org/z/rT9zjMhe1
```cpp
struct A {};
using CA = const A;
struct B : CA {};
```
Clang trunk prints:
```shell
warning: 'const' qualifier on base class type 'CA' (aka 'const A') have no effect [-Wignored-qualifiers]
```
Of course this should say has no effect, not have no effect.
The culprit is obvious from [the source code](https://github.com/llvm/llvm-project/blob/cac67d39362b23466708e464c00ce84abe16bece/clang/include/clang/Basic/DiagnosticSemaKinds.td#L489-L494):
```cpp
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">,
InGroup<IgnoredQualifiers>, DefaultIgnore;
The latter says "have" when it should say "%plural{1:has|:have}1".
````
https://github.com/Quuxplusone/llvm-project/issues/46
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs