-
Notifications
You must be signed in to change notification settings - Fork 68
Closed
Labels
Difficulty-LowA false positive or false negative report which is expected to take <1 day effort to addressA false positive or false negative report which is expected to take <1 day effort to addressImpact-Mediumfalse positive/false negativeAn issue related to observed false positives or false negatives.An issue related to observed false positives or false negatives.user-reportIssue reported by an end user of CodeQL Coding StandardsIssue reported by an end user of CodeQL Coding Standards
Description
Affected rules
A7-1-2
Description
A constexpr
function only returns a compile-time constant when provided with compile-time constants as arguments. The query currently incorrectly considers constexpr
functions to always return constants.
Example
This function should only be considerd
constexpr int add(int x, int y) {
return x + y;
}
void test(int p) {
int x = add(1,2); // NON_COMPLIANT - could be marked constexpr
int y = add(1,p); // COMPLIANT - cannot be marked constexpr
Metadata
Metadata
Assignees
Labels
Difficulty-LowA false positive or false negative report which is expected to take <1 day effort to addressA false positive or false negative report which is expected to take <1 day effort to addressImpact-Mediumfalse positive/false negativeAn issue related to observed false positives or false negatives.An issue related to observed false positives or false negatives.user-reportIssue reported by an end user of CodeQL Coding StandardsIssue reported by an end user of CodeQL Coding Standards
Type
Projects
Status
Done