Skip to content

Commit f2b1a9a

Browse files
Fix ql query metadata, cpp format
1 parent 5b33319 commit f2b1a9a

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

cpp/misra/src/rules/RULE-0-2-3/UnusedTypeWithLimitedVisibility.ql

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/**
2+
* @id cpp/misra/unused-type-with-limited-visibility
3+
* @name RULE-0-2-3: Types with limited visibility should be used at least once
4+
* @description Types that are unused with limited visibility are unnecessary and should either be
5+
* removed or may indicate a developer mistake.
6+
* @kind problem
7+
* @precision very-high
8+
* @problem.severity error
9+
* @tags external/misra/id/rule-0-2-3
10+
* scope/single-translation-unit
11+
* maintainability
12+
* correctness
13+
* external/misra/enforcement/decidable
14+
* external/misra/obligation/advisory
15+
*/
16+
117
import cpp
218
import codingstandards.cpp.misra
319
import codingstandards.cpp.types.Uses

cpp/misra/test/rules/RULE-0-2-3/test.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,7 @@ void test_alias_template() { AliasTemplate2<int> l1; }
158158

159159
// Test case 13: Primary class template usage
160160
namespace {
161-
template <typename T> struct D1 {
162-
T m1;
163-
}; // COMPLIANT - D1<int> is used
161+
template <typename T> struct D1 { T m1; }; // COMPLIANT - D1<int> is used
164162

165163
void test_class_template_usage() { D1<int> l1{42}; }
166164
} // namespace

0 commit comments

Comments
 (0)