Skip to content

[QOI] warn about free functions which shadow one in a namespace #6739

@llvmbot

Description

@llvmbot
Bugzilla Link 6367
Version unspecified
OS All
Reporter LLVM Bugzilla Contributor
CC @DougGregor,@zygoloid

Extended Description

I would like clang to optionally warn me about 'f0' in this:

ddunbar@giles:tmp$ cat t.cpp

void f1();
namespace foo {
  void f0();
  void f1();
}
void f0() {} // expected-warning {{something nice}}
void f1() {}

ddunbar@giles:tmp$ clang -Wall -c t.cpp
ddunbar@giles:tmp$

I almost never care to implement a non-static, undeclared function. I want clang to point out that I am doing this when it can find a 'f0' inside a different namespace. I want a fixit for adding 'foo::'.

Metadata

Metadata

Assignees

Labels

bugzillaIssues migrated from bugzillacheck-requestRequest for a new check in clang-tidyclang-tidy

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions