Fixed bug related to missing copy constructor for static_var #51
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
BuildIt had a bug where static_var didn't have a custom copy constructor. As a result when we have code like -
where y is also a static_var, the default copy constructor is called. This is mostly OK for copying the internal stored value, but the static_var's tracking tuple is not recorded. As a result the call to the destructor fails trying to pop the tracking tuple off the stack.
This change adds 2 new copy constructors for static_var and static_var. Consequently 2 new operator= also need to be defined, since the copy constructor is user defined.
sample12 has been changed to test this behavior.