File tree Expand file tree Collapse file tree 2 files changed +39
-7
lines changed Expand file tree Collapse file tree 2 files changed +39
-7
lines changed Original file line number Diff line number Diff line change @@ -31,16 +31,32 @@ The check will suggest adding the appropriate namespace qualification:
3131 - void process() {}
3232 + void utils::process() {}
3333
34- Options
35- -------
36-
37- None
34+ The check will not warn about:
35+ - Static functions or member functions;
36+ - Functions in anonymous namespaces;
37+ - The `` main `` function.
3838
3939Limitations
4040-----------
4141
42- - Does not warn about functions in anonymous namespaces
42+ - Does not warn about friend functions:
43+
44+ .. code-block :: c++
45+
46+ namespace llvm::gsym {
47+ struct MergedFunctionsInfo {
48+ friend bool operator==(const llvm::gsym: :MergedFunctionsInfo &LHS,
49+ const llvm::gsym: :MergedFunctionsInfo &RHS);
50+ };
51+ }
52+
53+ using namespace llvm::gsym;
54+
55+ bool operator==(const MergedFunctionsInfo &LHS, // no warning in this version
56+ const MergedFunctionsInfo &RHS) {
57+ return LHS.MergedFunctions == RHS.MergedFunctions;
58+ }
59+
4360- Does not warn about template functions
44- - Does not warn about static functions or member functions
4561- Does not warn about variadic functions
46- - Does not warn about the `` main `` function
62+
Original file line number Diff line number Diff line change 1+ // RUN: %check_clang_tidy %s misc-shadowed-namespace-function %t
2+
3+
4+ namespace foo { struct A ; }
5+ void f1 (foo::A);
6+
7+ namespace foo {
8+ struct A {
9+ friend void f0 (A);
10+ friend void f1 (A);
11+ };
12+ }
13+
14+ // FIXME: provide warning without fixit in these two cases
15+ void f0 (foo::A) {}
16+ void f1 (foo::A) {}
You can’t perform that action at this time.
0 commit comments