C++: Don't use deprecated predicates in test

This made the `expected` file contain QL line numbers.
This commit is contained in:
Jonas Jensen
2019-09-04 13:21:45 +02:00
parent 745e321e3b
commit b14b65ecf0
3 changed files with 9 additions and 9 deletions

View File

@@ -74,19 +74,22 @@ class NestedTypedefType extends TypedefType {
override string getCanonicalQLClass() { result = "NestedTypedefType" }
/**
* DEPRECATED
* DEPRECATED: use `.hasSpecifier("private")` instead.
*
* Holds if this member is private.
*/
deprecated predicate isPrivate() { this.hasSpecifier("private") }
/**
* DEPRECATED
* DEPRECATED: `.hasSpecifier("protected")` instead.
*
* Holds if this member is protected.
*/
deprecated predicate isProtected() { this.hasSpecifier("protected") }
/**
* DEPRECATED
* DEPRECATED: use `.hasSpecifier("public")` instead.
*
* Holds if this member is public.
*/
deprecated predicate isPublic() { this.hasSpecifier("public") }

View File

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

View File

@@ -8,13 +8,13 @@ string describe(TypedefType t) {
t instanceof NestedTypedefType and
result = "NestedTypedefType"
) or (
t.(NestedTypedefType).isPrivate() and
t.(NestedTypedefType).hasSpecifier("private") and
result = "(NestedTypedefType).isPrivate()"
) or (
t.(NestedTypedefType).isProtected() and
t.(NestedTypedefType).hasSpecifier("protected") and
result = "(NestedTypedefType).isProtected()"
) or (
t.(NestedTypedefType).isPublic() and
t.(NestedTypedefType).hasSpecifier("public") and
result = "(NestedTypedefType).isPublic()"
) or exists(Type base |
base = t.getBaseType() and