-
Notifications
You must be signed in to change notification settings - Fork 68
Closed
Labels
Difficulty-HighA false positive or false negative report which is expected to take 1+ week effort to addressA false positive or false negative report which is expected to take 1+ week 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
A12-8-6
Description
The type hierarchy of templates and template specializations is not considered when determining base types.
Example
template <class T1> class BaseClass7 {
public:
BaseClass7() {}
BaseClass7(BaseClass7 const &) = default; // NON_COMPLIANT
BaseClass7(BaseClass7 &&) = default; // NON_COMPLIANT
BaseClass7 &operator=(BaseClass7 const &) = default; // NON_COMPLIANT
BaseClass7 &operator=(BaseClass7 &&) = default; // NON_COMPLIANT
int operator=(int i); // COMPLIANT - not an assignment operator
}; // COMPLIANT
template <class T>
class DerivedClass7 // COMPLIANT - not a base class itself
: public BaseClass7<T> {
public:
DerivedClass7() {}
};
void test() {
BaseClass7<int> b;
DerivedClass7<int> d;
}
Metadata
Metadata
Assignees
Labels
Difficulty-HighA false positive or false negative report which is expected to take 1+ week effort to addressA false positive or false negative report which is expected to take 1+ week 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