Skip to content

fix placement new issue#2315

Merged
guwirth merged 1 commit intoSonarOpenCommunity:masterfrom
guwirth:fix-2314
Feb 15, 2022
Merged

fix placement new issue#2315
guwirth merged 1 commit intoSonarOpenCommunity:masterfrom
guwirth:fix-2314

Conversation

@guwirth
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
Copy Markdown

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