mirror of
https://github.com/github/codeql.git
synced 2026-05-04 05:05:12 +02:00
C++: Remove arguable FPs re: sizeof/decltype
This commit is contained in:
@@ -77,6 +77,10 @@ int test(int i, int j, int (*foo)(int), int (*bar)(int, int))
|
||||
j++);
|
||||
(void)sizeof(x.foo(i++), // GOOD
|
||||
j++);
|
||||
using U = decltype(x.foo(i++), // GOOD? Unlikely to be misread
|
||||
j++);
|
||||
(void)sizeof(x.foo(i++), // GOOD? Unlikely to be misread
|
||||
j++);
|
||||
|
||||
// Comma in loops
|
||||
|
||||
@@ -86,6 +90,11 @@ int test(int i, int j, int (*foo)(int), int (*bar)(int, int))
|
||||
i = j = i + j;
|
||||
}
|
||||
|
||||
while (i = foo(j++), // GOOD??? Currently ignoring loop heads
|
||||
i != j && i != 42 && !foo(j)) {
|
||||
i = j = i + j;
|
||||
}
|
||||
|
||||
for (i = 0, // GOOD? Currently ignoring loop heads.
|
||||
j = 1;
|
||||
i + j < 10;
|
||||
|
||||
Reference in New Issue
Block a user