-
Notifications
You must be signed in to change notification settings - Fork 68
Closed as not planned
Closed as not planned
Copy link
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-MediumStandard-AUTOSARuser-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
The query alerts on a move constructor declaration outside the class body.
Per [dcl.constexpr]
paragraph 1, a constexpr
shall only be applied to the declaration of a function with the additional constraint that all of its declarations shall contain the constexpr
. When the advice associated with the alert is followed, this results in the compilation error:
error: constexpr declaration of 'MyClass' follows non-constexpr declaration
Example
File: myclass.hpp
class MyClass {
public:
...
MyClass(MyClass&&) noexcept;
...
private:
int data;
}
File: myclass.cpp
MyClass::MyClass(MyClass&&) noexcept = default;
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-MediumStandard-AUTOSARuser-reportIssue reported by an end user of CodeQL Coding StandardsIssue reported by an end user of CodeQL Coding Standards
Type
Projects
Status
Closed (Duplicate)