Skip to content

Query cpp/unused-static-variable was producing incorrect results for constexpr variables#2239

Merged
jbj merged 1 commit intogithub:masterfrom
dragonmux:master
Nov 1, 2019
Merged

Query cpp/unused-static-variable was producing incorrect results for constexpr variables#2239
jbj merged 1 commit intogithub:masterfrom
dragonmux:master

Conversation

@dragonmux
Copy link
Contributor

Made the query check that the variable is not constexpr before it will issue a warning.
This stops it producing false positives where the only uses, and therefore appearances in the AST, are constexpr, which results in the value of the variable rather than the variable itself appearing in the AST.

@dragonmux dragonmux requested a review from a team as a code owner October 31, 2019 22:54
@ghost
Copy link

ghost commented Oct 31, 2019

CLA assistant check
All committers have signed the CLA.

@jbj jbj added the C++ label Nov 1, 2019
Copy link
Contributor

@jbj jbj left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution! We've been trying lately to get the necessary information out of the C++ front-end that we use, but at this point we're out of ideas, so your workaround is most welcome.

I'll just run the tests, and then we can merge.

@jbj jbj merged commit 426565a into github:master Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants