mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
CPP: 'if constexpr' test cases.
This commit is contained in:
@@ -56,4 +56,29 @@ int f(int x) {
|
||||
|
||||
// GOOD (has comment): [FALSE POSITIVE]
|
||||
if (x) {} // comment
|
||||
|
||||
// GOOD
|
||||
if (x) {
|
||||
if constexpr(1) {
|
||||
f();
|
||||
}
|
||||
}
|
||||
|
||||
// GOOD
|
||||
if (x) {
|
||||
if constexpr(0) {
|
||||
f();
|
||||
}
|
||||
}
|
||||
|
||||
// GOOD
|
||||
if (x) {
|
||||
if constexpr(1) {
|
||||
f();
|
||||
} else {
|
||||
f();
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user