File tree Expand file tree Collapse file tree
cpp/ql/test/query-tests/Best Practices/Likely Errors/EmptyBlock Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11| empty_block.cpp:9:10:9:11 | { ... } | Empty block without comment. |
22| empty_block.cpp:12:10:13:3 | { ... } | Empty block without comment. |
33| empty_block.cpp:20:10:21:3 | { ... } | Empty block without comment. |
4+ | empty_block.cpp:84:14:85:3 | { ... } | Empty block without comment. |
5+ | empty_block.cpp:93:10:94:3 | { ... } | Empty block without comment. |
6+ | empty_block.cpp:99:10:100:3 | { ... } | Empty block without comment. |
7+ | empty_block.cpp:100:10:101:3 | { ... } | Empty block without comment. |
Original file line number Diff line number Diff line change @@ -80,5 +80,25 @@ int f(int x) {
8080 }
8181 }
8282
83+ // BAD
84+ if (x > 1 ) {
85+ }
86+
87+ // GOOD
88+ if (x) {
89+ ++x;
90+ }
91+
92+ // DUBIOUS (reported)
93+ if (x) {
94+ } else {
95+ ++x;
96+ }
97+
98+ // BAD (x2)
99+ if (x) {
100+ } else {
101+ }
102+
83103 return 1 ;
84104}
You can’t perform that action at this time.
0 commit comments