File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -19,25 +19,31 @@ The rule is an experimental rule that must be explicitly enabled in a rule set f
1919``` cpp
2020// A.h
2121struct X ;
22+ ```
2223
24+ ```
2325// A.cpp
26+ #include "A.h"
2427
2528// Not flagged, declared in a header file.
2629struct X { int x; };
2730
2831struct Y { double y; }; // warning: Move 'Y' to anonymous namespace or put a forward declaration in a common header included in this file.
2932
30- void f(); // warning: Move 'Y ' to anonymous namespace or put a forward declaration in a common header included in this file.
33+ void f(); // warning: Move 'f ' to anonymous namespace or put a forward declaration in a common header included in this file.
3134```
3235
33- To resolve this issue :
36+ One way to resolve these issues is to move ` struct Y ` into an anonymous namespace, and move the declaration of ` f ` into a header :
3437
3538``` cpp
3639// A.h
3740struct X ;
3841void f ();
42+ ```
3943
44+ ``` cpp
4045// A.cpp
46+ #include " A.h"
4147
4248// Not flagged, declared in a header file.
4349struct X { int x; };
@@ -48,5 +54,4 @@ namespace {
4854
4955// Not flagged, declared in a header file.
5056void f();
51-
5257```
You can’t perform that action at this time.
0 commit comments