-
Notifications
You must be signed in to change notification settings - Fork 49
ostream recursive loop in find_noncopyable_vars #71
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
Comments
The test is not run by the test suite for the moment.
Thanks. I added a small test to the hot fix/v1.8.6 branch, which reproduces the problem, based on your code. I will investigate this. |
These tests are still disabled as they are is still failing, but they now clearly show the problem.
I am making good progress. Took me some time, but I was able to write a simplified test that shows an equivalent problem. The situation in too In fact, it is quite easy to end up in that the infinite recursion state with a hierarchy of 3 classes, and some pointers holding references to one of the other classes. I will work on a fix now. I probably just need to keep a list of the classes that have already been visited, and prevent them to be visited again. I'll work on this tomorrow though, writing the test and debugging the code already took me forever. But it is an interesting problem. Weird nobody ever stumbled over this before, because it is not an unlikely scenario. |
To fix this bug, a list of already parsed variables is passed trhough the different methods. This is optional. In general, if you call is_noncopyable, you do not need to provide the list
I pushed a fix to the |
Thanks, it fixed the recursion issue for me. |
Cool. I will publish the 1.8.6 release with the fix during the weekend. |
Hi,
I found the problem I had with the recursive loop in find_noncopyable_vars. It appears to happen for a class with a stream variable(std::istream*) and when base classes are known for ostream in class_declaration.hierarchy_info_t in is_noncopyable().
I think ::std::basic_ostream processes it base class std::basic_ios which holds a pointer to ostream and so on.
Stream.zip
The text was updated successfully, but these errors were encountered: