-
Notifications
You must be signed in to change notification settings - Fork 0
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
Bug in example? #1
Comments
Huh, logically thinking about it, I think you should be right, but if I run it, it does not trigger the check. We can experiment with Contracts feature in Godbolt using GCC latest branch: It looks like the However, you can see it works for [[post: top == old_top - 42]] Doing the same for [[post: top == old_top + 2]] Wonder if it's worth bringing up on the mailing list about, or maybe there's a more obvious reason why it's being stripped? |
Hmm, this is super strange. I played around with it a bit and it breaks in various combinations that seem to be not related. For example, staring with your godbold
And while the original 'problem' with line 16 is visible above (the line is white, so no code generated for it), line 25 HAS code associated with it (yellowish bg color) ( Ah I see... If we get rid of the warning (i.e. put a Yes, I would bring this up on the list (I do not know of any list ;). |
This seems like a pretty big gotcha that might be well to note somewhere, thank you for discovering this! |
We have this code:
gcc-invariant-plugin/test/test.cpp
Lines 24 to 30 in 207d9e5
Will this not always trigger the
post
condition check, because, well, line 26 and 29 directly contradict?Maybe lines 28 and 29 have to be swapped?
The text was updated successfully, but these errors were encountered: