Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b14b65e

Browse files
committed
C++: Don't use deprecated predicates in test
This made the `expected` file contain QL line numbers.
1 parent 745e321 commit b14b65e

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

cpp/ql/src/semmle/code/cpp/TypedefType.qll

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,22 @@ class NestedTypedefType extends TypedefType {
7474
override string getCanonicalQLClass() { result = "NestedTypedefType" }
7575

7676
/**
77-
* DEPRECATED
77+
* DEPRECATED: use `.hasSpecifier("private")` instead.
78+
*
7879
* Holds if this member is private.
7980
*/
8081
deprecated predicate isPrivate() { this.hasSpecifier("private") }
8182

8283
/**
83-
* DEPRECATED
84+
* DEPRECATED: `.hasSpecifier("protected")` instead.
85+
*
8486
* Holds if this member is protected.
8587
*/
8688
deprecated predicate isProtected() { this.hasSpecifier("protected") }
8789

8890
/**
89-
* DEPRECATED
91+
* DEPRECATED: use `.hasSpecifier("public")` instead.
92+
*
9093
* Holds if this member is public.
9194
*/
9295
deprecated predicate isPublic() { this.hasSpecifier("public") }

cpp/ql/test/library-tests/typedefs/Typedefs3.expected

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
WARNING: Predicate isPrivate has been deprecated and may be removed in future (Typedefs3.ql:11,27-36)
2-
WARNING: Predicate isProtected has been deprecated and may be removed in future (Typedefs3.ql:14,27-38)
3-
WARNING: Predicate isPublic has been deprecated and may be removed in future (Typedefs3.ql:17,27-35)
41
| ODASA-6095-A.hpp:5:25:5:30 | mytype | MyTemplate<X>::mytype | NestedTypedefType, getBaseType() = MyTemplate<X>, member of MyTemplate<X> |
52
| ODASA-6095-B.hpp:6:43:6:49 | mytype2 | MyTemplate2<X>::mytype2 | NestedTypedefType, getBaseType() = decltype(...), member of MyTemplate2<X> |
63
| file://:0:0:0:0 | mytype | MyTemplate<char>::mytype | NestedTypedefType, getBaseType() = MyTemplate<char>, member of MyTemplate<char> |

cpp/ql/test/library-tests/typedefs/Typedefs3.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ string describe(TypedefType t) {
88
t instanceof NestedTypedefType and
99
result = "NestedTypedefType"
1010
) or (
11-
t.(NestedTypedefType).isPrivate() and
11+
t.(NestedTypedefType).hasSpecifier("private") and
1212
result = "(NestedTypedefType).isPrivate()"
1313
) or (
14-
t.(NestedTypedefType).isProtected() and
14+
t.(NestedTypedefType).hasSpecifier("protected") and
1515
result = "(NestedTypedefType).isProtected()"
1616
) or (
17-
t.(NestedTypedefType).isPublic() and
17+
t.(NestedTypedefType).hasSpecifier("public") and
1818
result = "(NestedTypedefType).isPublic()"
1919
) or exists(Type base |
2020
base = t.getBaseType() and

0 commit comments

Comments
 (0)