-
Notifications
You must be signed in to change notification settings - Fork 72
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
warning for meaningless class combinations #246
Conversation
Can you also add a test? It can be a simple compilation test that checks if the warnings are printed correctly (see source/compiler/tests). Maybe optionally check valid combinations of specifiers so that some future change doesn't break them by accident. |
I have added the tests in a separate branch to prevent the commits from polluting this PR with bad commits. I'll move them here in a single commit once I'm sure that I'm doing this right. Test script: YashasSamaga@52b97f6 CMakeLists.txt change: YashasSamaga@b3ed64b Is that how it is supposed to be?
|
Could you add a test for warning pop/disable/push around it please? Just to ensure it will work in the very rare case where it is desired. Thanks. |
|
@Y-Less Those directives work independently of the commits in this PR. The commits in this PR use the As one could expect, the directives will work with this warning too:
Output:
|
Test name should refer to the bug/issue number, not the PR number since it tests that there is no bug, not that the PR works. If a PR adds some new feature I wouldn't add its number to the name at all. It could be useful to know where is the original bug report on GitHub that a test addresses, but not as much useful to know which PR implemented the fix (or a feature). It could also be multiple PRs that address the same problem. Well, I don't know, it's kind of hard to explain, maybe I'm overcomplicating things and everybody should just name tests whatever they want.... I didn't do a lot of automated tests in the past. Just use a descriptive name that makes sense and is short enough to fit on screen. |
ccdd612
to
2a16a6d
Compare
1. Adds a generic new warning which is triggered when meaningless combination of class specifiers are used. 2. This commit adds code to trigger a warning for the following two cases: - constant reference - - not meaningful as as references always point to cells in PAWN (unlike C++ where it would help costly copies while guaranteeing to not modify the object) which makes const reference is as good as pass-by-value - constant variable arguments - - for similar reasons as in the previous case
5f7691b
to
57ef615
Compare
11b5ca1
to
a8ca60b
Compare
#172
Adds a generic new warning which is triggered when meaningless combination of class specifiers are used.
This commit adds code to trigger a warning for the following two cases: