-
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-Highfalse 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
M7-5-1
Rule 7–5–1
A function shall not return a reference or a pointer to
an automatic variable (including parameters), defined
within the function
Description
When a function returns a reference to a class member, this class member is wrongly considered as an automatic variable.
Example
class M7_5_1 {
private:
/// Variable to be referenced
std::uint32_t val_;
public:
/// Triggers M7_5_1
std::uint32_t& M7_5_1() noexcept {
return val_;
}
}
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-Highfalse 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