Skip to content

Commit 5609f09

Browse files
fjatWbyTlcartey
andauthored
Apply suggestions from code review
Co-authored-by: Luke Cartey <5377966+lcartey@users.noreply.github.com>
1 parent 327436c commit 5609f09

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

cpp/autosar/src/rules/A14-5-2/NonTemplateMemberDefinedInTemplate.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ where
169169
)
170170
) and
171171
// Omit using alias (cf. https://github.com/github/codeql-coding-standards/issues/739)
172-
not d instanceof UsingAliasTypedefType
172+
// Exclude Using alias which refer directly to a TypeParameter
173+
not d.(UsingAliasTypedefType).getBaseType() instanceof TemplateParameter
173174
select d,
174175
"Member " + d.getName() + " template class does not use any of template arguments of its $@.",
175176
d.getDeclaringType(), "declaring type"

cpp/autosar/test/rules/A14-5-2/test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ template <typename T> class C1 {
88
enum E1 : T { e1, e2 }; // COMPLIANT
99

1010
using T1 = typename template_base<T>::type; // COMPLIANT
11-
using T2 = typename template_base<int>::type; // NON_COMPLIANT[FALSE_NEGATIVE]
11+
using T2 = typename template_base<int>::type; // NON_COMPLIANT
1212

1313
class C11 { // COMPLIANT
1414
enum E2 {

0 commit comments

Comments
 (0)