Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A2-10-5: Do not consider variable template instantiations as a reuse of the name #33

Closed
Assignees
lcartey
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
@lcartey

Description

@lcartey

Affected rules

  • A2-10-5

Description

A2-10-5 requires that non-member objects are given a unique name (irrespective of scope). However, the query does not currently account forvariable templates, which are represented as multiple different variables in the CodeQL C/C++ model.

I think the most straightforward fix here is to exclude the variable template instantiations, and only use the un-instantiated template, e.g.:

noto1.isFromTemplateInstantiation(_)andnoto2.isFromTemplateInstantiation(_)

Example

template<classT>constexpr T number_one = T(1);inttest() {return number_one<int>;}longtest2() {return number_one<long>;}

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


    [8]ページ先頭

    ©2009-2025 Movatter.jp