Skip to content

C++: Do not use deprecated hasLocationInfo in FlowTestCommon #19515

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cpp/ql/lib/utils/test/dataflow/FlowTestCommon.qll
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module IRFlowTest<IRDataFlow::GlobalFlowSig Flow> implements TestSig {
n =
strictcount(int line, int column |
Flow::flow(any(IRDataFlow::Node otherSource |
otherSource.hasLocationInfo(_, line, column, _, _)
otherSource.getLocation().hasLocationInfo(_, line, column, _, _)
Copy link
Preview

Copilot AI May 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider extracting the repeated getLocation().hasLocationInfo pattern into a helper predicate or variable to improve readability and reduce duplication across these test modules.

Suggested change
otherSource.getLocation().hasLocationInfo(_, line, column, _, _)
hasLocationInfo(otherSource, line, column)

Copilot uses AI. Check for mistakes.

), sink)
) and
(
Expand Down Expand Up @@ -55,7 +55,7 @@ module AstFlowTest<AstDataFlow::GlobalFlowSig Flow> implements TestSig {
n =
strictcount(int line, int column |
Flow::flow(any(AstDataFlow::Node otherSource |
otherSource.hasLocationInfo(_, line, column, _, _)
otherSource.getLocation().hasLocationInfo(_, line, column, _, _)
Copy link
Preview

Copilot AI May 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] This call is identical to the one above in the IR flow tests; you might centralize it in a shared helper to keep both clauses in sync.

Copilot uses AI. Check for mistakes.

), sink)
) and
(
Expand Down
Loading