@@ -44,35 +44,46 @@ int Foo::test(int (*baz)(int))
44
44
(void )i, // BAD
45
45
(void )j;
46
46
47
+ if (1 ) FOO (i),
48
+ (void )x.foo (j); // BAD
49
+
47
50
// Parenthesized comma (borderline example):
48
51
49
52
foo (i++), j++; // GOOD
50
53
(foo (i++), j++); // GOOD
51
54
(foo (i++), // GOOD
52
55
j++);
53
56
(foo (i++),
54
- j++); // BAD (?)
57
+ foo (i++),
58
+ j++, // GOOD (?) -- Currently explicitly excluded
59
+ j++);
55
60
56
61
x.foo (i++), j++; // GOOD
57
62
(x.foo (i++), j++); // GOOD
58
63
(x.foo (i++), // GOOD
59
64
j++);
60
65
(x.foo (i++),
61
- j++); // BAD (?)
66
+ x.foo (i++),
67
+ j++, // GOOD (?) -- Currently explicitly excluded
68
+ j++);
62
69
63
70
FOO (i++), j++; // GOOD
64
71
(FOO (i++), j++); // GOOD
65
72
(FOO (i++), // GOOD
66
73
j++);
67
74
(FOO (i++),
68
- j++); // BAD (?)
75
+ FOO (i++),
76
+ j++, // GOOD (?) -- Currently explicitly excluded
77
+ j++);
69
78
70
79
(void )(i++), j++; // GOOD
71
80
((void )(i++), j++); // GOOD
72
81
((void )(i++), // GOOD
73
82
j++);
74
83
((void )(i++),
75
- j++); // BAD (?)
84
+ (void )(i++),
85
+ j++, // GOOD (?) -- Currently explicitly excluded
86
+ j++);
76
87
77
88
// Comma in argument list doesn't count:
78
89
@@ -102,7 +113,7 @@ int Foo::test(int (*baz)(int))
102
113
j++);
103
114
104
115
BAZ (" %d %d\n " , i,
105
- j); // GOOD [FALSE POSITIVE] -- but can only be excluded by excluding all parenthesized commas (which sounds like a good idea actually)
116
+ j); // GOOD -- Currently explicitly excluded
106
117
107
118
// Comma in loops
108
119
@@ -128,10 +139,10 @@ int Foo::test(int (*baz)(int))
128
139
129
140
// Mixed tabs and spaces (ugly case):
130
141
131
- for (i = 0 , // GOOD if tab >= 4 spaces else BAD -- can't exclude w/o source code text :/
142
+ for (i = 0 , // GOOD if tab >= 4 spaces else BAD -- Currently ignoring loop heads.
132
143
j = 0 ;
133
144
i + j < 10 ;
134
- i++, // GOOD if tab >= 4 spaces else BAD -- can't exclude w/o source code text :/
145
+ i++, // GOOD if tab >= 4 spaces else BAD -- Currently ignoring loop heads.
135
146
j++);
136
147
137
148
if (i)
@@ -140,13 +151,13 @@ int Foo::test(int (*baz)(int))
140
151
141
152
// LHS ends on same line RHS begins on:
142
153
143
- int k1 = ( foo (
154
+ if ( 1 ) foo (
144
155
i++
145
- ), j++) ; // GOOD? [FALSE POSITIVE]
156
+ ), j++; // GOOD? [FALSE POSITIVE]
146
157
147
- int k2 = ( baz (
158
+ if ( 1 ) baz (
148
159
i++
149
- ), j++) ; // GOOD when it's a function-pointer call !?
160
+ ), j++; // GOOD... when calling a function pointer.. !?
150
161
151
162
// Weird cases:
152
163
0 commit comments