Skip to content

Ungrammatical warning message "const qualifier have no effect" #125942

Closed
@a-tarasyuk

Description

@a-tarasyuk

https://godbolt.org/z/rT9zjMhe1

struct A {};
using CA = const A;
struct B : CA {};

Clang trunk prints:

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:

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".

Quuxplusone#46

Metadata

Metadata

Assignees

Labels

clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions