File tree Expand file tree Collapse file tree 2 files changed +30
-3
lines changed
cpp/ql/test/query-tests/Best Practices/Likely Errors/EmptyBlock Expand file tree Collapse file tree 2 files changed +30
-3
lines changed Original file line number Diff line number Diff line change 1
- | empty_block.cpp:7 :10:7 :11 | { ... } | Empty block without comment |
2
- | empty_block.cpp:10 :10:11 :3 | { ... } | Empty block without comment |
3
- | empty_block.cpp:18 :10:19 :3 | { ... } | Empty block without comment |
1
+ | empty_block.cpp:9 :10:9 :11 | { ... } | Empty block without comment |
2
+ | empty_block.cpp:12 :10:13 :3 | { ... } | Empty block without comment |
3
+ | empty_block.cpp:20 :10:21 :3 | { ... } | Empty block without comment |
Original file line number Diff line number Diff line change
1
+ // semmle-extractor-options: -std=c++17
2
+
1
3
// GOOD:
2
4
void f () {
3
5
}
@@ -54,4 +56,29 @@ int f(int x) {
54
56
55
57
// GOOD (has comment): [FALSE POSITIVE]
56
58
if (x) {} // comment
59
+
60
+ // GOOD
61
+ if (x) {
62
+ if constexpr (1 ) {
63
+ f ();
64
+ }
65
+ }
66
+
67
+ // GOOD
68
+ if (x) {
69
+ if constexpr (0 ) {
70
+ f ();
71
+ }
72
+ }
73
+
74
+ // GOOD
75
+ if (x) {
76
+ if constexpr (1 ) {
77
+ f ();
78
+ } else {
79
+ f ();
80
+ }
81
+ }
82
+
83
+ return 1 ;
57
84
}
You can’t perform that action at this time.
0 commit comments