Skip to content

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

@Quuxplusone

Description

@Quuxplusone

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions