Skip to content
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

Fix construction of bitref or bitranges object with a temp bitvec to not dangle #1988

Merged
merged 1 commit into from
Jul 9, 2019

Conversation

ChrisDodd
Copy link
Contributor

  • obscure corner case -- when a ctor is called with an rvalue ref to a
    temp, the lifetime of that temp is only until the end of the ctor --
    we need to have it persist until the dtor is called.

Copy link
Contributor

@mihaibudiu mihaibudiu left a comment

Choose a reason for hiding this comment

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

This is why i don't like c++

@cc10512
Copy link
Contributor

cc10512 commented Jul 9, 2019

This would be an ideal candidate for adding some gtests.

@mihaibudiu
Copy link
Contributor

cpplint does not like this change

…not dangle.

- obscure corner case -- when a ctor is called with an rvalue ref to a
  temp, the lifetime of that temp is only until the end of the ctor --
  we need to have it persist until the dtor is called.
@ChrisDodd
Copy link
Contributor Author

cpplint was failing to recognize the && as an rvalue reference modifer on the method rather than a logical and operator, so I modified the script for this case (its a pretty hacky collection of regexes to classify things). Also added gtest

@ChrisDodd ChrisDodd merged commit 8acc550 into p4lang:master Jul 9, 2019
@mihaibudiu
Copy link
Contributor

Is there a newer version of cpplint we can rebase our prior changes on?
Or perhaps we can contribute this fix back as well?

@KekeZheng KekeZheng mentioned this pull request Feb 23, 2022
@ChrisDodd ChrisDodd deleted the bitrange-rvalue branch January 7, 2025 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants