Skip to content

fix placement new issue #2315

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

Merged
merged 1 commit into from
Feb 15, 2022
Merged

Conversation

guwirth
Copy link
Collaborator

@guwirth guwirth commented Feb 15, 2022

Sample:

::new(p)A(1,2,3)

This change is Reviewable

- close SonarOpenCommunity#2314

Sample:
```C++
::new(p)A(1,2,3)
```
@guwirth guwirth added the bug label Feb 15, 2022
@guwirth guwirth added this to the 2.0.7 milestone Feb 15, 2022
@guwirth guwirth self-assigned this Feb 15, 2022
@guwirth guwirth merged commit 78d1bee into SonarOpenCommunity:master Feb 15, 2022
@slnj
Copy link

slnj commented Feb 15, 2022

Hi Günter,
Its now accepting the placement-param, but it still required the returned value to be assigned.
It's accepting p = ::new(p)A(1,2,3) but not just ::new(p)A(1,2,3)
When the pointer is passed as placement-param, it is returned unchanged so the returned value should be able to be discarded.
Regards

@guwirth
Copy link
Collaborator Author

guwirth commented Feb 15, 2022

Hi @slnj ,

I did a succesfull test with the sslr toolkit and an unit test:

void test() {
  ::new(p)A(1,2,3);
}

How does your code look like?

Regards,

@slnj
Copy link

slnj commented Feb 15, 2022

My fault. I tried with sslr toolkit without putting it on a function and there it's only accept the assignment one, but putting it inside a function it is accepted.
It's running ok.

Regards

@guwirth guwirth deleted the fix-2314 branch July 26, 2022 09:07
@guwirth guwirth restored the fix-2314 branch July 26, 2022 09:14
@guwirth guwirth deleted the fix-2314 branch February 8, 2023 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

new with placement-params is not parsed
2 participants