Merge pull request #16230 from MathiasVP/fix-join-in-global-use-before-init

C++: Use interpolation to avoid a bad join order
This commit is contained in:
Mathias Vorreiter Pedersen
2024-04-16 18:17:11 +01:00
committed by GitHub
2 changed files with 3 additions and 4 deletions

View File

@@ -110,6 +110,5 @@ from GlobalVariable v, Function f
where
uninitialisedBefore(v, f) and
useFunc(v, f)
select f,
"The variable '" + v.getName() + "'" +
" is used in this function but may not be initialized when it is called."
select f, "The variable $@ is used in this function but may not be initialized when it is called.",
v, v.getName()

View File

@@ -1 +1 @@
| test.cpp:27:5:27:6 | f1 | The variable 'b' is used in this function but may not be initialized when it is called. |
| test.cpp:27:5:27:6 | f1 | The variable $@ is used in this function but may not be initialized when it is called. | test.cpp:14:5:14:5 | b | b |