codeql-coding-standards
codeql-coding-standards copied to clipboard
`A5-16-1`: Ternary operator not used as a sub expression
Affected rules
- A5-16-1
Description
CodeQL triggers A5-16-1 on a plain ternary expression.
Example
const auto smallestSet = (setA.size() < setB.size() ? setA : setB);
Thanks for this report! This is because the parentheses in your example are considered as the parent of ternary expression. However, one of the rule examples makes it clear that this case should be excluded.