Skip to content

DCL51: use-of-single-underscore-reserved-prefix hits when using lambda functions. #57

Closed
@MFaisalZaki

Description

@MFaisalZaki

Affected rules

  • cpp/cert/use-of-single-underscore-reserved-prefix

Description

The rule generates an alert on normal lambda functions.
Message: " Name _FUN uses the reserved prefix "

Example

#include <iostream>
#include <string>

int main() {

    auto is_digit = [](std::string& word) {
			std::string::const_iterator it = word.begin();
			while (it != word.end() && std::isdigit(*it)) ++it;
			return !word.empty() && it == word.end();
		};

    std::string my_word("10");
    auto test_word = is_digit(my_word);

    return 0;
}

Metadata

Metadata

Assignees

Labels

Difficulty-LowA 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.user-reportIssue reported by an end user of CodeQL Coding Standards

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions