mirror of
https://github.com/github/codeql.git
synced 2026-05-02 04:05:14 +02:00
C++: Initial commit of cpp/comma-before-missing-indentation
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<!DOCTYPE qhelp PUBLIC
|
||||
"-//Semmle//qhelp//EN"
|
||||
"qhelp.dtd">
|
||||
<qhelp>
|
||||
|
||||
<overview>
|
||||
<p>...</p>
|
||||
</overview>
|
||||
|
||||
<recommendation>
|
||||
<p>...</p>
|
||||
</recommendation>
|
||||
|
||||
<example>
|
||||
<sample src="CommaBeforeMisleadingIndentation.cpp" />
|
||||
</example>
|
||||
|
||||
</qhelp>
|
||||
@@ -0,0 +1 @@
|
||||
select 1
|
||||
@@ -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