Skip to content

Commit fff63e6

Browse files
committed
IdentifierHidden: omit types
1 parent edf41d5 commit fff63e6

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

cpp/common/src/codingstandards/cpp/Scope.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ class UserDeclaration extends Declaration {
7171
not this instanceof ClassTemplateInstantiation and
7272
// compiler inferred parameters have name of p#0
7373
not this.(Parameter).getName() = "p#0"
74+
and not this instanceof Type
7475
}
7576
}
7677

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
| test.cpp:4:5:4:7 | id1 | Declaration is hiding declaration $@. | test.cpp:1:5:1:7 | id1 | id1 |
22
| test.cpp:8:5:8:7 | id1 | Declaration is hiding declaration $@. | test.cpp:1:5:1:7 | id1 | id1 |
3-
| test.cpp:11:5:11:7 | id1 | Declaration is hiding declaration $@. | test.cpp:8:5:8:7 | id1 | id1 |
43
| test.cpp:20:7:20:9 | id1 | Declaration is hiding declaration $@. | test.cpp:1:5:1:7 | id1 | id1 |
54
| test.cpp:23:13:23:15 | id1 | Declaration is hiding declaration $@. | test.cpp:1:5:1:7 | id1 | id1 |
65
| test.cpp:26:12:26:14 | id1 | Declaration is hiding declaration $@. | test.cpp:1:5:1:7 | id1 | id1 |
@@ -10,4 +9,3 @@
109
| test.cpp:70:12:70:12 | i | Declaration is hiding declaration $@. | test.cpp:61:7:61:7 | i | i |
1110
| test.cpp:75:16:75:16 | i | Declaration is hiding declaration $@. | test.cpp:61:7:61:7 | i | i |
1211
| test.cpp:81:5:81:5 | a | Declaration is hiding declaration $@. | test.cpp:79:5:79:5 | a | a |
13-
| test.cpp:85:13:85:13 | a | Declaration is hiding declaration $@. | test.cpp:79:5:79:5 | a | a |

cpp/common/test/rules/identifierhidden/test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ int a() {} // NON_COMPLIANT
8282
} // namespace b
8383

8484
namespace b1 {
85-
typedef int a; // NON_COMPLIANT
85+
typedef int a; // COMPLIANT - do not consider types
8686
}
8787

8888
namespace ns_exception1_outer {

0 commit comments

Comments
 (0)