Skip to content

A14-5-2: type member dependent on class' template parameter detected not dependent #739

Closed
@fjatWbyT

Description

@fjatWbyT

Affected rules

  • A14-5-2

Description

Type member defined with a dependent name and template parameter results in recommendation to be defined in a separated class because it is identified to be not dependent on the template parameter.

Example

template<typename T>
struct a_template_struct {
  using type = T;
};

template<typename T>
struct another_template_struct {
  using type = typename a_template_struct<T>::type;
};

Query cpp/autosar/src/rules/A14-5-2/NonTemplateMemberDefinedInTemplate.ql outputs that another_template_struct::type does not use any of the template arguments of another_template_struct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty-MediumA false positive or false negative report which is expected to take 1-5 days effort to addressImpact-MediumStandard-AUTOSARfalse 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