mirror of
https://github.com/github/codeql.git
synced 2026-05-05 13:45:19 +02:00
C++: Initial commit of cpp/comma-before-missing-indentation
This commit is contained in:
@@ -0,0 +1 @@
|
||||
| 1 |
|
||||
@@ -0,0 +1 @@
|
||||
Best Practices/Likely Errors/CommaBeforeMisleadingIndentation.ql
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
void test(int i, int j, int (*foo)(int))
|
||||
{
|
||||
if (i)
|
||||
(void)i, // GOOD
|
||||
(void)j;
|
||||
|
||||
if (i)
|
||||
(void)i, // BAD
|
||||
(void)j;
|
||||
|
||||
foo((i++, j++)); // GOOD
|
||||
foo((i++, // GOOD
|
||||
j++));
|
||||
foo((i++
|
||||
, j++)); // GOOD
|
||||
foo((i++,
|
||||
j++)); // BAD (?)
|
||||
}
|
||||
Reference in New Issue
Block a user